Copy Code code as follows:
<summary>
Set the page not to be cached
</summary>
private void Setpagenocache ()
{
Response.Buffer = true;
Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds (-1);
Response.Expires = 0;
Response.CacheControl = "No-cache";
Response.appendheader ("Pragma", "No-cache");
}
1, cancel the cache
(2) Client cancellation
Copy Code code as follows:
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Pragma" content= "No-cache" >
(3) Service Appliance End Cancellation:
Server side:
Copy Code code as follows:
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 Inside:
Copy Code code as follows:
protected void Application_BeginRequest (Object sender, EventArgs e)
{
HttpContext.Current.Response.Cache.SetNoStore ();
}
<%@ OutPutCache location= "None"%>
Page base class:
Copy Code code as follows:
public class Pagebase:page
{
Public pagebase () {}
protected override OnLoad (EventArgs e) {
Response.Cache.SetNoStore ();
Base. OnLoad ();
}
}
The easiest way to:-)
Learn csdn this forum, after the URL randomly add some useless parameters, such as:
Yun_qi_img/xxx.jpg?p=xxx
IE uses a URL to control the cache, which solves the