-
- Response.Buffer = True
- Response.ExpiresAbsolute = Now() - 1
- Response.Expires = 0
- Response.CacheControl = "no-cache"
- Response.AddHeader "Pragma", "No-Cache"
Copy the code
2. Add it to the html code
3. Pass a parameter to the page when re-calling the original page Href="****.asp?random()"
The first two methods are said to fail sometimes, while the third method is to pass a random parameter when jumping!
Because aspx's cache is related to parameters, if the parameters are different, the cache will not be used, but the page will be regenerated. Passing a random parameter each time can avoid using the cache.
This only applies 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 the code
add these codes in the middle of :
-
- <%
- response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
- response.setHeader("Pragma","no-cache" ; replace("WebForm1.aspx");
The parameter is the page to be covered.
-
- The principle of replace: Use the current page to replace the page specified by the replace parameter.
This prevents the user from hitting the back key.
-
javascript script, examples are as follows:
a.html
a
b
Copy code
b.html
b
a
Copy code
6. PHP disable page caching
# Let it "expire" in the pastheader("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Always modified 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
-
>>>> Articles you may be interested in:
Parsing PHP and browser caching mechanism
Example of how to immediately refresh cached output in php
Example of php page caching (reducing the burden on cpu and mysql)
How to disable client-side caching of aspx pages
Introduction to how to cancel the cache of asp.net
How to clear IE page cache for asp.net
Summary of methods to clear IE cache (asp asp.net php, etc.)
asp Introduction to clearing IE cache
php prohibits page caching output code
php code to disable page caching
A php function to disable page caching
How to prevent IE from caching jsp files
Analysis of ASP.NET caching methods
asp.net performance optimization method-caching data and page output
|