Question

It seems that IE6 ignores any form of cache invalidation sent via http headers, I've tried setting Pragma to No Cache and setting Cache Expiration to the current time, yet in IE6, hitting back will always pull up a cached version of a page I am working on.

Is there a specific HTTP Header that IE6 does listen too?

Was it helpful?

Solution

Cache-Control: private, max-age=0 should fix it. From classic ASP this is done with Response.Expires=-1.

Keep in mind when testing that just because your server is serving pages with caching turned off doesn't mean that the browser will obey that when it has an old cached page that it was told was okay to cache. Clear the cache or use F5 to force that page to be reloaded.

Also, for those cases where the server is serving cached content it you can use Ctrl+F5 to signal the server not to serve it from cache.

OTHER TIPS

You must be careful. If you are using AJAX via XMLHttpRequest (XHR), cache "recommendations" set in the header are not respected by ie6.

The fix is to use append a random number to the url queries used in AJAX requests. For example:

http://test.com?nonce=0123 

A good generator for this is the UTC() function that returns a unique timestame for the user's browser... that is, unless they mess with their system clock.

Have you tried setting an ETag in the header? They're a pretty reliable way to indicate that content has changed w3c Spec & Wikipedia

Beyond that, a little more crude way is to append a random query string parameter to the request, such as the current unix timestamp. As I said, crude, but then IE6 is not the most subtle of beasts

A little note: By experience I know that IE6 will load Javascript from cache even if forced to reload the page via ctrl-f5. So if you are working on Javascript always empty the cache.

The IE web developer toolbar can help immensely with this. There's a button for clearing the cache.

Content with "Content-Encoding: gzip" Is Always Cached Although You Use "Cache-Control: no-cache"

http://support.microsoft.com/kb/321722

You could also disable gzip just for IE6

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top