IE6 and Caching

久未见 提交于 2019-12-03 17:29:18
Hafthor

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!