以下的 方法是禁止页面缓存,对于特定的BS还是需要的,Function:
1 2 3 4 5 6 7 8 9 |
//禁止页面缓存 public static void ForbidPageCache() { System.Web.HttpContext.Current.Response.Buffer = true; System.Web.HttpContext.Current.Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1); System.Web.HttpContext.Current.Response.Expires = 0; System.Web.HttpContext.Current.Response.CacheControl = "no-cache"; System.Web.HttpContext.Current.Response.AddHeader("Pragma", "No-Cache"); } |