Summary of methods to disable page caching for ASP.

Source: Internet
Author: User
1, in the ASP page header

  Response.Buffer   =   True      response.expiresabsolute   = Now   ()   -   1      response.expires   =   0      Response.CacheControl   =   "No-cache"      response.addheader   "Pragma",   " No-cache "

2. Add in HTML code

  <HEAD>      <meta   http-equiv= "Pragma"   content= "No-cache" >      <meta   http-equiv= "Cache-control"   content= "No-cache" >      <meta   http-equiv= "Expires"   content= "0" >      </HEAD>

3, 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, Window.location.replace ("WebForm1.aspx");
The parameter is the page you want to overwrite, and replace replaces the page specified by the Replace parameter with the current page.
This prevents the user from clicking the back key. JavaScript scripts are used, for example:

A.html


The first 3 types just empty the cache, that is, the temporary files stored in the Temporary Internet Files folder, and the 4th is to replace the current paging file with a jump page file, without emptying the cache, which means temporary the internet Files produced the relevant temporary file.

more ways to disable page caching in ASP. Summary related articles please follow topic.alibabacloud.com!
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.