Cache?

P

Paulo

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!
 
A

Anthony Jones

Bob Barrows said:

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.
 
B

Bob Barrows [MVP]

Anthony said:
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.
 
E

Evertjan.

Anthony Jones wrote on 17 okt 2008 in
microsoft.public.inetserver.asp.general:
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/how-do-i-prevent-my-asp-pages-from-
caching.html>


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

news.alltel.net

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
 
E

Evertjan.

news.alltel.net wrote on 17 okt 2008 in
microsoft.public.inetserver.asp.general:
Evertjan. said:
Anthony Jones wrote on 17 okt 2008 in
[......]
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/how-do-i-prevent-my-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]
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() %>"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top