asp.net禁止页面缓存,适合各种浏览器

客户端:

<html>
<head>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
</head>

服务器端:
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
Response.Expires = 0;
Response.CacheControl = "no-cache";
Response.Cache.SetNoStore();

Global:
protected void Application_BeginRequest(Object sender, EventArgs e)
{
HttpContext.Current.Response.Cache.SetNoStore();
}
<%@ OutPutCache Location="None"%>

posted @ 2010-04-27 11:10  —无 名  阅读(379)  评论(0编辑  收藏  举报