简体   繁体   English

如何禁用页面缓存?

[英]How to disable caching of page?

In my web application I have a problem with the browser back button, so I used this code to disable caching,I cleared all the cache from the browser but it didn't work. 在我的Web应用程序中,浏览器的后退按钮有问题,因此我使用此代码禁用了缓存,我从浏览器中清除了所有缓存,但没有用。

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

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

//Proxies
response.setDateHeader("Expires", 0);

我知道这听起来很傻,但是请尝试使缓存无效并重试(例如:浏览器中的CTRL-F5)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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