Java中禁止浏览器开启缓存的方法命令
响应头里添加禁止浏览器缓存的内容
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
其中,Cache-Control
用于HTTP1.1(包括1.1)以上;Pragma
用于HTTP1.0;Expires
用于代理服务器缓存。
Java(JSP)的命令
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "0");
人与人之间的区别,在于是否能管理好自己