Html、Asp、Php、Jsp禁止页面缓存
html:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="wed, 26 feb 1997 08:21:57 gmt">
<meta http-equiv="expires" content="0">
php:
1.
header("expires: mon, 26 jul 1997 05:00:00 gmt");
header("cache-control: no-cache, must-revalidate");
header("pragma: no-cache");
2.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
asp:
1.
response.expires=0
response.addheader("pragma","no-cache")
response.addheader("cache-control","no-cache, must-revalidate")
2.
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
jsp:
response.addheader("cache-control", "no-cache");
response.addheader("expires", "thu, 01 jan 1970 00:00:01 gmt");
申明
非源创博文中的内容均收集自网上,若有侵权之处,请及时联络,我会在第一时间内删除.再次说声抱歉!!!
博文欢迎转载,但请给出原文连接。