Disable image caching?

N

Noozer

I load a webpage on my client PC, change an image file on the server, and
reload the webpage on the client. I still see the orignal image.

Currently I have the following at the top of my page source:
<%
response.ContentType = "image/jpeg"
Response.CacheControl = "no-cache, must-revalidate"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
Response.AddHeader "Last-Modified", date
%>

IIS is set to expire content immediately.

What do I need to do to ensure that the images are fresh from the server
every time? (...and I did search Google and no solutions I could find made
any difference.)

Thx!
 
T

Toby Inkster

Noozer said:
Currently I have the following at the top of my page source:
<%
response.ContentType = "image/jpeg"
Response.CacheControl = "no-cache, must-revalidate"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
Response.AddHeader "Last-Modified", date
%>

At the top of the *page* or the top of the *image*. You need to send these
headers with the *image*. (Alternatively, just change the image file name
every time you update it.)
 
N

Noozer

Toby Inkster said:
At the top of the *page* or the top of the *image*. You need to send these
headers with the *image*. (Alternatively, just change the image file name
every time you update it.)

Doh!

Thanks... Moving it to the image seems to have it working as needed. I
assumed that at the top of the page I was telling it not to cache any
images.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top