Common "Cache-control" values include private, no-cache, max-age, and must-revalidate.

Source: Internet
Author: User
The Cache of web pages is controlled by "cache-control" in the HTTP message header. common values include private, no-Cache, max-age, and must-revalidate, the default value is private. The function of browser review is divided into the following situations:
(1) open a new window
If the cache-control values are private, no-cache, and must-revalidate, the server will be accessed again when a new window is opened. If the max-age value is specified, the server will not be accessed again within the time range. For example:
Cache-control: max-age = 5
Indicates that the webpage will not go to the server again within 5 seconds after it is accessed.
(2) Press enter in the address bar.
If the value is private or must-revalidate (not the same as on the Internet), the server will be accessed only when the first access is made and will not be accessed later. If the value is no-cache, it will be accessed every time. If the value is max-age, the access will not be repeated before expiration.
(3) Back and press the button
If the values are private, must-revalidate, and max-age, no re-access will be performed. If the value is no-cache, the access will be repeated each time.
(4) press the refresh button
No matter what the value is, it will be accessed again

When the Cache-control value is "no-cache", accessing this page will not leave page backup in the temporary article folder on the Internet.
In addition, specifying the "Expires" value also affects the cache. For example, if you specify the Expires value as a time that has passed, if you repeatedly press enter in the address bar when accessing this network, the access will be repeated each time:
Expires: Fri, 31 Dec 1999 16:00:00 GMT

In ASP, the Expires and ExpiresAbsolute attributes of the Response object can be used to control the Expires value. The CacheControl attribute of the Response object can be used to control the Cache-control value. For example:
Response. ExpiresAbsolute = #2000-1-1 # 'specifies the absolute expiration time, which is the local time of the server and is automatically converted to GMT.
Response. Expires = 20' specifies the relative expiration time, in minutes, which indicates how many minutes have expired since the current time.
Response. CacheControl = "no-cache"
The Expires value can be viewed by viewing the properties of the temporary file in the Temporary Internet folder, for example:

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: 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.