解决浏览器回退页面数据还存在问题

浏览器可以回退。都是因为浏览器进行了缓存。所以记住了上一级操作。要想解决这个。就是禁用页面缓存。

增加如下代码:

response.addHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.addHeader("Cache-Control", "pre-check=0, post-check=0");
response.setDateHeader("Expires", -1);

猜你喜欢

转载自blog.csdn.net/saygood999/article/details/109469555