How to prevent caching in Internet Explorer 9 via HTTP response headers in java?

I am trying to limit the caching of a PDF file by setting the headers below in java code:

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

This works fine with IE 8. However, it does not work with IE 9, and it still caches the file in the temoporary internet files folder.

Can anyone shed some light on him?

Thanks and respect,

Frame

+5
source share
5 answers
response.setDateHeader("Expires", 1L);
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.addHeader("Cache-Control", "no-store");

I usually use.

+1
source

I used this and it works.

// 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");
+1
source

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/>

NOT...

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

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

, , -, .

0
0
source

All Articles