Most of them can be used when adding operations to the database such as content calculation and user registration. If you are allowed to go back and the page happens to be refreshed, the adding operation will be performed again. Undoubtedly, this is not what we need, as many caches are prohibited on the Internet. The code is sometimes unreliable. In this case, you only need to add it to the operation page. Specify the new page to be directed in the web page, and then click Back to see if it will not return to the previous operation page. In fact, this history has been deleted
''''''''''''''''''''''''''''''''''''ASP Script
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = no-cache
///////////////////////////////////////////ASP.NET Script
Copy the code code as follows:
Response.Buffer=true;
Response.ExpiresAbsolute=DateTime.Now.AddSeconds(-1);
Response.Expires=0;
Response.CacheControl=no-cache;
ASP disabling caching added:
Response.ExpiresAbsolute =Now() - 1
Response.Expires=0
Response.CacheControl=no-cache
Ajax method to force no caching
1. Add a random number
xmlHttp.open(GET, ajax.asp?now= + new Date().getTime(), true);
2. Write a code that disables caching in the asp page to be obtained asynchronously:
Response.Buffer =True
Response.ExpiresAbsolute =Now() - 1
Response.Expires=0
Response.CacheControl=no-cache
3. Add xmlHTTP.setRequestHeader(If-Modified-Since,0); before sending ajax request to disable caching
xmlHTTP.open(get, URL, true);
xmlHTTP.onreadystatechange = callHTML;
xmlHTTP.setRequestHeader(If-Modified-Since,0);
xmlHTTP.send();
4. header(Cache-Control: no-cache, must-revalidate);