CloudFront Caching - How can I ensure that CF is updated from the S3 origin server upon expiration?

I put assets in S3 with expiration headers that are successfully transferred to CloudFront distributions. However, requests after expiration do not cause CloudFront to request a new file from the source server.

I also find that query string version tokens do not force a new asset, and I do not want to use the full file name.

All this may be due to my poor knowledge of cache control headers, but I am starting to doubt that I am missing something critical about how CloudFront should work. CloudFront responses display headers as shown below.

Cache-Control: max-age=120
Expires: Tue, 07 Apr 2009 12:13:26 GMT
+5
source share
3 answers

Time passes, and everything changes. As Tim noted, the smallest cache time was 24 hours, but in April 2010, Amazon announced that they would recognize and follow cache directives for up to an hour.

Announcement here: http://developer.amazonwebservices.com/connect/ann.jspa?annID=655

+9
source

Amazon seems to be ignoring expiration times of less than 24 hours. http://developer.amazonwebservices.com/connect/thread.jspa?messageID=107699꒳

+4
source

Matchu, , , !

http://aws.amazon.com/about-aws/whats-new/2012/03/19/amazon-cloudfront-lowers-minimum-expiration-period/

TTL 0 . TTL , .

, :

Expires CloudFront , .

We recommend that you use the max-age Cache-Control directive instead of the Expires header field to control object caching. If you specify values ​​for both max-age Cache-Control and Expires, CloudFront uses only the max-age value.

0
source

All Articles