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 ",ArticleFolder left page backup.
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: