(Web page cache control) HTML Configuration No-cache (Memo) "Cache-control" common values

Source: Internet
Author: User
Tags local time

HTML config no-cache (memo)

No-cache Configuration


The HTML table header is as follows

    1. <Meta http-equiv= "content-type" content= "text/html; Charset=utf-8 " />
    2. <!--HTTP 1.1--
    3. <Meta http-equiv= "pragma" content="No-cache">
    4. <!--HTTP 1.0--
    5. <Meta http-equiv= "cache-control" content="No-cache">
    6. <!--Prevent caching at the proxy server--
    7. <Meta http-equiv= "expires" content="0">
    8. <Meta http-equiv= "x-ua-compatible" content="ie=emulateie9" />

"Cache-control" common values are private, No-cache, Max-age, must-revalidate, etc.

The cache of the Web page is controlled by the "Cache-control" in the HTTP message header, and the common values are private, No-cache, Max-age, must-revalidate, etc. The default is private. Its function is divided into the following situations depending on the way in which it is browsed:
(1) Open a new window
If the value of the specified Cache-control is private, No-cache, Must-revalidate, The server will be re-accessed when a new window is opened. If you specify a max-age value, the server is not re-accessed in the time within this value, for example:
cache-control:max-age=5 The
indicates that access to this webpage will not go to the server again within 5 seconds of accessing the page
(2) in the Address bar enter
If the value is private or must-revalidate (not the same as on the web), The server will be accessed only on the first visit and will no longer be accessed at a later time. If the value is No-cache, it is accessed every time. If the value is Max-age, access is not repeated until it expires.
(3) Press Back button
If the value is private, must-revalidate, max-age, it is not re-accessed, and if it is No-cache, the access is repeated every time
(4) Press the refresh button
no matter what the value, it will be repeated access

When you specify a Cache-control value of "No-cache", accessing this page does not leave a page backup in the Temporary Internet Article folder.
Also, the cache is affected by specifying a value of "Expires". For example, to specify that the expires value is a long past time, then when you visit this network repeatedly press ENTER in the Address bar, then each time will be repeated access:
Expires:fri, Dec 1999 16:00:00 GMT

In ASP, the expires value can be controlled through the expires, ExpiresAbsolute properties of the response object, and response values are controlled by CacheControl properties of an object, for example:
Response.ExpiresAbsolute = #2000 -1-1# ' Specifies an absolute expiration time with the server local time, which is automatically converted to GMT time
Response.Expires = 20 ' Specifies the relative expiration time, in minutes, that indicates how many minutes have expired from the current time.
Response.CacheControl = "No-cache"
The expires value is seen by the properties of the temporary file that can be viewed in the Temporary Internet folder

(Web page cache control) HTML Configuration No-cache (Memo) "Cache-control" common values

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.