HTML:
<meta http-equiv="Expires"
CONTENT="0">
<meta http-equiv="Cache-Control"
CONTENT="no-cache">
//
IE
5以下被忽略
<meta http-equiv="Pragma"
CONTENT="no-cache">
ASP:
Response.Expires =
0
Response.ExpiresAbsolute =
Now()
-
1
Response.CacheControl =
"no-cache"
ASP.net/ C#:
modified from:
http://blog.joycode.com/uestc95/posts/22507.aspx
// Date
in
the
past
HttpContext.Current.Response.Expires =
0;
HttpContext.Current.Response.ExpiresAbsolute=DateTime.Now.AddDays(-1);
// always
modified
HttpContext.Current.Response.AppendHeader("Last-Modified", DateTime.Now.ToString("r",
DateTimeFormatInfo.InvariantInfo);
// HTTP/1.0
HttpContext.Current.Response.AddHeader("pragma","no-cache");
// HTTP/1.1
HttpContext.Current.Response.AddHeader("cache-control","private");
HttpContext.Current.Response.CacheControl="no-cache";
PHP:
modified from:
phpManual
// Date
in
the
past
header("Expires: Mon,
26
Jul
1997
05:00:00
GMT");
// always
modified
header("Last-Modified: "
.
gmdate("D,
d
M
Y
H:i:s")
.
"
GMT");
// HTTP/1.1
header("Cache-Control: no-store,
no-cache,
must-revalidate");
header("Cache-Control: post-check=0,
pre-check=0",
false);
// HTTP/1.0
header("Pragma: no-cache");
JSP:
response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","No-cache");
全文摘自:http://www.newsmth.net/pc/pccon.php?id=1396&nid=142815
<meta
<meta
<meta
ASP:
Response.Expires
Response.ExpiresAbsolute
Response.CacheControl
ASP.net/ C#:
modified
//
HttpContext.Current.Response.Expires
HttpContext.Current.Response.ExpiresAbsolute=DateTime.Now.AddDays(-1);
//
HttpContext.Current.Response.AppendHeader("Last-Modified",
//
HttpContext.Current.Response.AddHeader("pragma","no-cache");
//
HttpContext.Current.Response.AddHeader("cache-control","private");
HttpContext.Current.Response.CacheControl="no-cache";
PHP:
modified
//
header("Expires:
//
header("Last-Modified:
//
header("Cache-Control:
header("Cache-Control:
//
header("Pragma:
JSP:
response.setDateHeader("Expires",
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","No-cache");
全文摘自:http://www.newsmth.net/pc/pccon.php?id=1396&nid=142815