保险起见,对html页面和jsp最好都加一些设置
对于HTM网页,加入:
<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);
%>
就可以了
其他的页面
ASP网页 Response.Expires = -1 Response.ExpiresAbsolute = Now() - 1 Response.cachecontrol = "no-cache"
PHP网页 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache");
本文介绍了如何通过在HTML、JSP、ASP及PHP等不同类型的网页中添加特定的元信息和HTTP头来禁用浏览器缓存,确保用户始终获取到最新的网页内容。
5298

被折叠的 条评论
为什么被折叠?



