Expires and max-age

Source: Internet
Author: User

Both Expires and max-age can be used to specify the document expiration time, but there are some nuances between the two.

 

1. Expires has been defined in HTTP/1.0. Cache-Control: max-age is defined only in HTTP/1.1. For backward compatibility, it is not enough to use max-age;

2. expires specifies an absolute Expiration Time (in GMT format). This will cause at least two problems. 1) the client and server time are not synchronized, leading to problems with Expires configuration. 2) it is easy to forget the specific expiration time after configuration, resulting in a surge in expiration;

3. max-age specifies the survival time after a document is accessed. This time is a relative value (for example, 3600 s ), the Request_time (request time) recorded by the server when the document is requested for the first time );

4. The time specified by Expires can be relative to the last access time (Atime) of the file or the modification time (MTime), while max-age is relative to the request time (Atime) of the document)

Http://www.cnblogs.com/yinhaiming/articles/1490811.html

Expires and max-age

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.