禁止页面缓存的有效方式
我在网上看到过方法
HTML:
??? <META???? HTTP-EQUIV="Pragma"???? CONTENT="no-cache">?
??? <META???? HTTP-EQUIV="Cache-Control"???? CONTENT="no-cache">?
??? <META???? HTTP-EQUIV="Expires"???? CONTENT="0">?
JSP:
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
但是我试过,都不管用,最后使出绝招
在form 标签或者不需要缓存的 input 标签中设值autocomplete="off" 即可,本人亲测,绝对有效
?