Prevent IE caching

后端 未结 5 1959
慢半拍i
慢半拍i 2020-12-23 22:39

I am developing a Java EE web application using Struts. The problem is with Internet Explorer caching. If an user logs out he can access some pages because they are cached a

5条回答
  •  青春惊慌失措
    2020-12-23 23:30

    Looks like IE < 9 will still cache even if you have pragma: no-cache in the head and set browser to refresh on each page load. You need to add the meta tags again in a second head section before close of the html. This is right from MS itself.

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

    little better explanation here

    http://www.htmlgoodies.com/beyond/reference/article.php/3472881/So-You-Dont-Want-To-Cache-Huh.htm

    From testing you also need the Expires: -1 meta tag to make it work. It is recommended to use Expires: -1 and not 0.

提交回复
热议问题