Connecting Tech Pros Worldwide Forums | Help | Site Map

Cache?

Paulo
Guest
 
Posts: n/a
#1: Oct 17 '08
Hi, how do I force the asp to read the imgs files on server without making
changings on IE settings like checking: Every visit on page...?

Any hint? any classic asp code line?

Thanks!



Bob Barrows [MVP]
Guest
 
Posts: n/a
#2: Oct 17 '08

re: Cache?


Paulo wrote:
Quote:
Hi, how do I force the asp to read the imgs files on server without
making changings on IE settings like checking: Every visit on page...?
>
Any hint? any classic asp code line?
>
http://www.aspfaq.com/show.asp?id=2022

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Paulo
Guest
 
Posts: n/a
#3: Oct 17 '08

re: Cache?


Many thanks Mr Barrows for the quick reply!

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomescreveu na mensagem
news:%231VhmU$LJHA.5060@TK2MSFTNGP02.phx.gbl...
Quote:
Paulo wrote:
Quote:
>Hi, how do I force the asp to read the imgs files on server without
>making changings on IE settings like checking: Every visit on page...?
>>
>Any hint? any classic asp code line?
>>
http://www.aspfaq.com/show.asp?id=2022
>
--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
>

Anthony Jones
Guest
 
Posts: n/a
#4: Oct 17 '08

re: Cache?




"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomwrote in message
news:%231VhmU$LJHA.5060@TK2MSFTNGP02.phx.gbl...
Quote:
Paulo wrote:
Quote:
>Hi, how do I force the asp to read the imgs files on server without
>making changings on IE settings like checking: Every visit on page...?
>>
>Any hint? any classic asp code line?
>>
http://www.aspfaq.com/show.asp?id=2022
>
That article relates to the caching of responses from an ASP page. However
the question really related to the caching of the imgs which are not
normally served up by ASP. IOW this is an IIS question not a ASP one.

The images should be placed in a common folder (or set of folders in a
common root folder). In IIS manager open properties on the folder and go to
the HTTP Headers tab. Turn on expiry and set to expiry today at midnight.
Add a custom header Cache-Control: no-cache.

That will sort the problems with cached images out.

--
Anthony Jones - MVP ASP/ASP.NET

Bob Barrows [MVP]
Guest
 
Posts: n/a
#5: Oct 17 '08

re: Cache?


Anthony Jones wrote:
Quote:
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomwrote in message
news:%231VhmU$LJHA.5060@TK2MSFTNGP02.phx.gbl...
Quote:
>Paulo wrote:
Quote:
>>Hi, how do I force the asp to read the imgs files on server without
>>making changings on IE settings like checking: Every visit on
>>page...? Any hint? any classic asp code line?
>>>
>http://www.aspfaq.com/show.asp?id=2022
>>
>
That article relates to the caching of responses from an ASP page. However
the question really related to the caching of the imgs which
are not normally served up by ASP. IOW this is an IIS question not a
ASP one.
The images should be placed in a common folder (or set of folders in a
common root folder). In IIS manager open properties on the folder
and go to the HTTP Headers tab. Turn on expiry and set to expiry
today at midnight. Add a custom header Cache-Control: no-cache.
>
That will sort the problems with cached images out.
My bad - I thought the article covered that. I should have reread it before
posting it.


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Evertjan.
Guest
 
Posts: n/a
#6: Oct 17 '08

re: Cache?


Anthony Jones wrote on 17 okt 2008 in
microsoft.public.inetserver.asp.general:
Quote:
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomwrote in message
news:%231VhmU$LJHA.5060@TK2MSFTNGP02.phx.gbl...
Quote:
>Paulo wrote:
Quote:
>>Hi, how do I force the asp to read the imgs files on server without
>>making changings on IE settings like checking: Every visit on
>>page...?
>>>
>>Any hint? any classic asp code line?
>>>
>http://www.aspfaq.com/show.asp?id=2022
>>
>
That article relates to the caching of responses from an ASP page.
However the question really related to the caching of the imgs which
are not normally served up by ASP. IOW this is an IIS question not a
ASP one.
>
The images should be placed in a common folder (or set of folders in a
common root folder). In IIS manager open properties on the folder and
go to the HTTP Headers tab. Turn on expiry and set to expiry today at
midnight. Add a custom header Cache-Control: no-cache.
>
That will sort the problems with cached images out.
Indeed "normally".
But for the "admormal" that have no access to the IIS internals.

To accomodate the latter the images could be called by the client from an
nonexisting directory, and on arrival at 404.asp detected and streamed to
the client after setting headers as in
<http://classicasp.aspfaq.com/general...sp-pages-from-
caching.html>


Perhaps even a
server.transfer "/realdir/myImage.jpg"
is possible, but I never tested that.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
news.alltel.net
Guest
 
Posts: n/a
#7: Oct 17 '08

re: Cache?


I don't have my code handy, but what I've done in the past is put a random
number after the image so it's unique.

<img src="\images\theImage.jpg?id=<%= random number here %>">

Then the browser thinks it's a different image and won't pull it from the
cache.

Ron

"Evertjan." <exjxw.hannivoort@interxnl.netwrote in message
news:Xns9B3AA35BD924Deejj99@194.109.133.242...
Quote:
Anthony Jones wrote on 17 okt 2008 in
microsoft.public.inetserver.asp.general:
>
Quote:
>"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomwrote in message
>news:%231VhmU$LJHA.5060@TK2MSFTNGP02.phx.gbl...
Quote:
>>Paulo wrote:
>>>Hi, how do I force the asp to read the imgs files on server without
>>>making changings on IE settings like checking: Every visit on
>>>page...?
>>>>
>>>Any hint? any classic asp code line?
>>>>
>>http://www.aspfaq.com/show.asp?id=2022
>>>
>>
>That article relates to the caching of responses from an ASP page.
>However the question really related to the caching of the imgs which
>are not normally served up by ASP. IOW this is an IIS question not a
>ASP one.
>>
>The images should be placed in a common folder (or set of folders in a
>common root folder). In IIS manager open properties on the folder and
>go to the HTTP Headers tab. Turn on expiry and set to expiry today at
>midnight. Add a custom header Cache-Control: no-cache.
>>
>That will sort the problems with cached images out.
>
Indeed "normally".
But for the "admormal" that have no access to the IIS internals.
>
To accomodate the latter the images could be called by the client from an
nonexisting directory, and on arrival at 404.asp detected and streamed to
the client after setting headers as in
<http://classicasp.aspfaq.com/general...sp-pages-from-
caching.html>
>
>
Perhaps even a
server.transfer "/realdir/myImage.jpg"
is possible, but I never tested that.
>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan.
Guest
 
Posts: n/a
#8: Oct 18 '08

re: Cache?


news.alltel.net wrote on 17 okt 2008 in
microsoft.public.inetserver.asp.general:
Quote:
>
"Evertjan." <exjxw.hannivoort@interxnl.netwrote in message
news:Xns9B3AA35BD924Deejj99@194.109.133.242...
Quote:
>Anthony Jones wrote on 17 okt 2008 in
[......]
Quote:
Quote:
Quote:
>>>
>>That article relates to the caching of responses from an ASP page.
>>However the question really related to the caching of the imgs which
>>are not normally served up by ASP. IOW this is an IIS question not
>>a ASP one.
>>>
>>The images should be placed in a common folder (or set of folders in
>>a common root folder). In IIS manager open properties on the folder
>>and go to the HTTP Headers tab. Turn on expiry and set to expiry
>>today at midnight. Add a custom header Cache-Control: no-cache.
>>>
>>That will sort the problems with cached images out.
>>
>Indeed "normally".
>But for the "admormal" that have no access to the IIS internals.
>>
>To accomodate the latter the images could be called by the client
>from an nonexisting directory, and on arrival at 404.asp detected and
>streamed to the client after setting headers as in
><http://classicasp.aspfaq.com/general...y-asp-pages-fr
>om- caching.html>
>>
>>
>Perhaps even a
>server.transfer "/realdir/myImage.jpg"
>is possible, but I never tested that.
[Please do not toppost on usenet and do not quote signatures]
Quote:
I don't have my code handy, but what I've done in the past is put a
random number after the image so it's unique.
>
<img src="\images\theImage.jpg?id=<%= random number here %>">
>
Then the browser thinks it's a different image and won't pull it from
the cache.
That is a not so nice [but useful] way, as you will fill up the browser
cashe with lot's of versions of the same image.

Anyway you do not need a random number, use the number of miliseconds
since a fixed point in time. That is unique as it is nonrepeating.

ASP Jscript:

src="\images\theImage.jpg?id=<% = new Date() %>"




--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Closed Thread