Cache-control in HTTP Header

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 does not leave page backup in the Temporary Internet folder.
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.

(For sensitive pages that require authenticate to be accessed, you can set it to no-Cache. In this way, each browser action requires a page refresh and change, the content filled in the page form will not be retained .)

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/guoqzhang/archive/2009/05/08/4161280.aspx

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.