1. Add
Reference content is as follows: Response. Buffer = true Response. expiresabsolute = now ()-1 Response. expires = 0 Response. cachecontrol = "no-Cache" Response. addheader "Pragma", "No-Cache" |
2. Add in HTML code
Reference content is as follows: <Head> <Meta HTTP-EQUIV = "Pragma" content = "no-Cache"> <Meta HTTP-EQUIV = "cache-control" content = "no-Cache"> <Meta HTTP-EQUIV = "expires" content = "0"> </Head> |
3. When you re-call the original page, you can pass a parameter href = "*****. asp? Random ()"
The first two methods are said to be invalid sometimes, and the third is to pass a random parameter during the jump! Because the cache of aspx is related to parameters, if the parameters are different, the cache will not be used, but the page will be regenerated. If a random parameter is passed every time, the cache can be avoided. This only applies to ASP & Asp.net
4. Use the following code on the JSP page to achieve no cache:
Reference content is as follows: 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 |
The code is added in the middle of
Reference content is as follows: <Head> <% 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 %> </Head> |
5. Window. Location. Replace ("webform1.aspx ");
The parameter is the page to be overwritten. The replace principle is to replace the page specified by the replace parameter with the current page.
This prevents users from clicking the back key. The Javascript script is used, for example:
| Reference content is as follows: A.html <HTML> <Head> <Title> A </title> <Script language = "JavaScript"> Function jump (){ Window. Location. Replace ("B .html "); } </SCRIPT> </Head> <Body> <A href = "javascript: Jump ()"> B </a> </Body> </Html> B .html <HTML> <Head> <Title> B </title> <Script language = "JavaScript"> Function jump (){ Window. Location. Replace ("a.html "); } </SCRIPT> </Head> <Body> <A href = "javascript: Jump ()"> A </a> </Body> </Html> |
The first four types only clear the cache, that is, temporary files stored in the Temporary Internet Files folder, and the fifth type is to use the jump page file to replace the current page file without clearing the cache, that is to say, Temporary Internet Files generate related temporary files. They are used together to clear the cache and are essential medicine. I have a record here, so I often look at it.