1

I am using CloudFront to distribute content from one of my domains. There is no S3 tie-in here. By default, content expires after 24 hours, which is fine for most of the data on the website, however, there are a few pages that I'd like to have only a 1 hour cache limit on. How do I go about setting this.

1 Answer 1

1

From the CloudFront FAQ:

Q. How long will Amazon CloudFront keep my files at the edge locations? By default, if no cache control header is set, each edge location checks for an updated version of your file whenever it receives a request more than 24 hours after the previous time it checked the origin for changes to that file. This is called the “expiration period.” You can set this expiration period as short as 1 hour, or as long as you’d like, by setting the cache control headers on your files in your origin. Amazon CloudFront uses these cache control headers to determine how frequently it needs to check the origin for an updated version of that file. If your files don’t change very often, it is best practice to set a long expiration period and implement a versioning system to manage updates to your files.

2
  • 1
    Thanks for the answer. I see a lot of answers say that, but I'm seeing nothing but confusion on how to do that(set the cache-control)
    – Macgyver
    Jan 18, 2012 at 15:04
  • 2
    If you are unfamiliar with cache control HTTP headers, you could submit a question that asks for pointers on that. If you are unfamiliar with how to set HTTP headers in your web server software, you could submit a question for pointers with that, too. You need to provide more details on what your environment is and what it is that you don't understand. Jan 18, 2012 at 18:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .