Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
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 '12 at 15:04
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. – Eric Hammond Jan 18 '12 at 18:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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