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");

posted @ 2013-12-12 10:05  Athrun  阅读(373)  评论(0编辑  收藏  举报