简体   繁体   中英

Forcing no-cache for internet explorer over HTTPS with HTTP response headers?

So, I recently found this little gem.

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

Essentially, IE doesn't haven't Cache-Control: no-cache properly over HTTPs, which breaks the download. However, I need to disable caching for a number of responses across my application which hit the same IO write path, which I can easily control.

Is there a way to get around this issue so that I can force no-caching in IE over HTTPS using nothing but response headers? It's unrealistic to expect my users to do a registry change to fix the broken behavior of IE.

There is no good solution. You can try adding the timestamp to your requests, though.

I just do this to clear out the cache headers set by the web container and it has worked fine

response.reset(); //workaround IE restriction against streaming to cache from SSL
response.setContentType("myMIMEType");
response.setHeader("Content-Disposition", "attachment; filename=\"" + whateverGoesHere + "\"");

Then send the file to output stream. Obviously if you want it rendered inside the browser window rather than a file save dialog, you wouldn't put do the attachment; disposition type.

Just encountered the same problem with IE8 (but not IE9), found the fix to be:

Pragma: private
Cache-Control: private, must-revalidate

Just in case somebody is still looking.

Try using:

Pragma: no-cache

From the HTTP Spec

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM