Disable page caching in multiple languages

Source: Internet
Author: User
Disable page caching in multiple languages

  1. Response. Buffer = True
  2. Response. ExpiresAbsolute = Now ()-1
  3. Response. Expires = 0
  4. Response. CacheControl = "no-cache"
  5. Response. AddHeader "Pragma", "No-Cache"

2. add in html code

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. disable cache on the jsp page:

  1. Response. setHeader ("Cache-Control", "no-cache"); /// HTTP 1.1
  2. Response. setHeader ("Pragma", "no-cache"); // HTTP 1.0
  3. Response. setDateHeader ("Expires", 0); // prevents caching at the proxy server

Add these codes Intermediate:

  1. <%
  2. Response. setHeader ("Cache-Control", "no-cache"); /// HTTP 1.1
  3. Response. setHeader ("Pragma", "no-cache"); // HTTP 1.0
  4. Response. setDateHeader ("Expires", 0); // prevents caching at the proxy server
  5. %>

5. window. location. replace ("WebForm1.aspx"); the parameter is the page to be overwritten.

Replace principle: replace the page specified by the replace parameter with the current page. This prevents users from clicking the back key.

Example: a.html

  1. A

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.