views:

1268

answers:

4

I have a statistics page which has a meta refresh tag on it.

<meta http-equiv="refresh" content="10" />

How do I stop it forcing a refresh of the images in the page too? I've tried setting Cache control but the browser (IE7) still refreshes the 50+ images in the page.

Response.Cache.AppendCacheExtension("post-check=900,pre-check=3600");
A: 

Maybe your IE is set to not cache images? How do you generate the images? Do they contain some kind of no-cache header?

Spikolynn
It's definately caching as when other pages use the same image URLs there's no further GET requests. It's only the http-equiv refresh that is forcing the images to expire immediately.
Ollie
A: 

This is not a complete answer but is the statistics page under SSL and are the image src getting set by css? I vaguely remember a similar problem I had where images did not get cached in IE when the page was under SSL and css was changing the image src (such as when hovering over a button, etc... it was not just standard html image tags... the images were getting src attribute changed through css.). So a combination of css, ssl, and IE caused the issue. Sorry I can't remember the exact issue we had but by preloading the images through javascript (and changing how we changed the buttons when hovering) we were able to resolve the issue. Might be something you want to check.

Jeff Widmer
A: 

Have you set up the expiry on your images folder in IIS?

Antony Scott
+2  A: 

I solved this issue by using javascript to manually refresh the page rather than the meta tag. This stopped the browser refreshing all the images on every reload, but still forced the browser to refresh the ASPX page itself.

<script>
setTimeout('document.location=document.location',10000)
</script>
Ollie