一般处理程序中,禁止缓存的办法!

   

if (context.Request.UrlReferrer != null)//防止用户直接访问本页面
{


//不让浏览器缓存 context.Response.Buffer = true; context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1); context.Response.AddHeader("pragma", "no-cache"); context.Response.AddHeader("cache-control", ""); context.Response.CacheControl = "no-cache"; context.Response.ContentType = "text/plain"; context.Response.ContentEncoding = Encoding.UTF8; context.Response.Charset = "UTF-8";
}

 

posted @ 2016-04-27 14:30  阿旭92312  阅读(330)  评论(0编辑  收藏  举报