views:

1510

answers:

2

I'm putting assets to S3 with expiry headers, which successfully get passed through to CloudFront distributions. However, requests after the expiry don't result in CloudFront requesting a fresh file from the origin server.

I am also finding that query string version tokens don't force a fresh asset, and I don't want to use full, file name versioning.

All of this may be down to my poor knowledge of cache-control headers, but I am starting to wonder if I am missing something critical about how CloudFront is supposed to work. The CloudFront responses are showing headers like the following.

Cache-Control: max-age=120
Expires: Tue, 07 Apr 2009 12:13:26 GMT
+2  A: 

Looks like Amazon ignores expiry times less than 24 hours. http://developer.amazonwebservices.com/connect/thread.jspa?messageID=107699&#107699

Tim Whitlock
+1  A: 

Time passes and things change. As Tim had noted, the lowest cache time was 24hrs but in April 2010 Amazon announced that they will recognize and follow directives for caching down to an hour.

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

John Mark Mitchell