- Response.Buffer = True
- Response.ExpiresAbsolute = Now ()-1
- Response.Expires = 0
- Response.CacheControl = "No-cache"
- Response.AddHeader "Pragma", "No-cache"
Copy Code2. Add in HTML code
-
-
-
-
Copy Code3, in the recall of the original page when the page passed a parameter href= "****.asp?random ()" The first two methods are said to sometimes fail, and the third is to pass a random parameter when jumping! Because the ASPX cache is parameter-dependent, the cache is not used if the parameters are different, and the page is regenerated, and a random argument is passed each time to avoid using the cache. This applies only to Asp&asp.net 4. Disable caching in JSP pages:
- Response.setheader ("Cache-control", "No-cache"); HTTP 1.1
- Response.setheader ("Pragma", "No-cache"); HTTP 1.0
- Response.setdateheader ("Expires", 0); Prevents caching at the proxy server
Copy CodeThese codes are added in the middle:
- <%
- Response.setheader ("Cache-control", "No-cache"); HTTP 1.1
- Response.setheader ("Pragma", "No-cache"); HTTP 1.0
- Response.setdateheader ("Expires", 0); Prevents caching at the proxy server
- %>
Copy Code5, Window.location.replace ("WebForm1.aspx"); The parameter is the page to overwrite. Replace principle: Replaces the page specified by the Replace parameter with the current page. This prevents the user from clicking the back key. JavaScript scripts, for example, are as follows: a.html
-
- A
- B
Copy CodeB.html
-
- B
-
- A
Copy Code6. PHP Disables page caching
# to make it "fail" in the past
- Header ("Expires:mon, Jul 1997 05:00:00 GMT");
# It's always been a change #
- Header ("last-modified:". Gmdate ("D, D M Y h:i:s"). " GMT ");
# http/1.1
- Header ("Cache-control:no-store, No-cache, must-revalidate");
- Header ("Cache-control:post-check=0, pre-check=0", false);
# http/1.0
- Header ("Pragma:no-cache");
Copy Code>>> you may be interested in the article: parsing PHP and browser caching mechanisms PHP instantly refreshes the cache output Method Example PHP page cache examples (minus the CPU with MySQL burden) How to disable the client cache for ASPX pages ASP. Methods of canceling caching introduction to the method of clearing IE page cache by ASP (ASP ASP. NET PHP, etc.) ASP The method of clearing IE cache to introduce PHP prohibit page cache output code PHP prohibit page cache code a PHP disable page caching function prevent IE cache jsp file methods ASP. NET caching Method analysis ASP. NET performance Optimization method-cache data and page output |