Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void DisableBrowserCache()
- {
- //back browser
- Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
- Response.Cache.SetValidUntilExpires(false);
- Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
- Response.Cache.SetCacheability(HttpCacheability.NoCache);
- Response.Cache.SetNoStore();
- //back browser and refresh
- //Response.ClearHeaders();
- //Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1
- //Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1
- //Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1
- //Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1
- //Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1
- //Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1
- //Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1
- //Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.1
- //Response.AppendHeader("Keep-Alive", "timeout=3, max=993"); // HTTP 1.1
- //Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.1}
- }
Advertisement
Add Comment
Please, Sign In to add comment