English 中文(简体)
如何防止互联网探索者9THU http 回应头在 Java 中出现缓冲?
原标题:How to prevent caching in Internet Explorer 9 thru http response headers in java?

我试图限制PDF文件的缓存,

response.setHeader("Cache-Control", "no-store");
response.setHeader("Expires", "0");

这对IE 8. 有效,但它在IE 9 方面有缺陷,它仍在将文件存于Temoporary Internet文件文件夹中。

谁能把灯亮一下吗?

感谢 & amp; 注意,

拉马

问题回答
response.setDateHeader("Expires", 1L);
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.addHeader("Cache-Control", "no-store");

我通常都用这个

我用过这个,效果也不错

// Set to expire far in the past.
response.setHeader("Expires", "Mon, 23 Aug 1982 12:00:00 GMT");

// Set standard HTTP/1.1 no-cache headers.
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");

// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
response.addHeader("Cache-Control", "post-check=0, pre-check=0");

// Set standard HTTP/1.0 no-cache header.
response.setHeader("Pragma", "no-cache");

只要这样,我就可以在Ie9
上工作

response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");<br/>
response.setHeader("Pragma","no-cache");<br/><br/>

但如果我加上

response.addHeader("Cache-Control", "post-check=0, pre-check=0");<br/>

then it does NOT work...

Please refer to:
http://blogs.msdn.com/b/ieinternals/archive/2009/07/20/using-post_2d00_check-and-pre_2d00_check-cache-directives.aspx

Cache-Control: no-cache, must-revalidate
Expires:Sat, 26 Jul 1997 05:00:00 GMT

应该是你想要的

我没有IE9,但您不妨在Cache- control 上进一步探讨。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签