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.
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.
This is handled with the regular HTTP cache control mechanisms (see RFC 2616) as documented in Amazon CloudFront Object Expiration, specifically:
You might also want to have a look at the table within Specifying the Minimum Time that CloudFront Caches Objects for Web Distributions to understand the peculiarities of the Minimum TTL = 0 (Default) (see my answer to What is a TTL 0 in CloudFront useful for? for a more detailed explanation of this feature).
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.