I know we can set the expires header to Amazon S3, but how do I set it for a cloudfront file ? I've read that we can set the TTL from 24hrs to 1hr, but I want to set it for 1 year.

link|improve this question

25% accept rate
feedback

2 Answers

This is handled with the regular HTTP cache control mechanisms (see RFC 2616) as documented in Amazon CloudFront Object Expiration, specifically:

You can specify a longer expiration time by using the Cache-Control, Pragma, or Expires header on the object in the origin server. [...] CloudFront does not restrict their maximum values.

The minimum expiration time you can specify is one hour. If you specify a minimum time of less than one hour, CloudFront uses one hour.

link|improve this answer
feedback

Why do you want to do that? Do you think that by doing so your files will be held closer to the edge for a whole year without a single origin pull? If so then that simply won't happen sorry, 24 hours is actually quite a long time for a CDN. If you're worried about your files dropping off the edge just distribute some VMs around the world that just periodically get your content (we call it 'tickling'), keeping your content at the edge.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.