开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜