java如何禁用页面缓存?
在我的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);
# 1 楼答案
我知道这听起来很傻,但请尝试使缓存无效,然后重试(例如:在浏览器中按CTRL-F5)