当点击后退按钮时,默认情况下浏览器不是从Web服务器上重新获取页面,而是从浏览器缓存中载入页面,那么怎么才能让HTML和JSP页面不缓存?
对于HTML网页,加入:
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
对于JSP页面,加入:
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
%>
参考
http://www.jb51.net/web/100639.html
http://stackoverflow.com/questions/49547/how-to-control-web-page-caching-across-all-browsers