How do I go about setting the cache control headers for specific files on my web server? I'm running a LAMP environment. I don't want to set the cache control sitewide, just for a few files. 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.
Thus you will have to orchestrate your LAMP stack to apply the desired
How this is done in particular depends on the tools/technologies used to serve the content of course, e.g.:
For an excellent overview about caching in general I recommend Mark Nottingham's Caching Tutorial.
Fyi, the answer above is still correct but slightly out of date in one respect, as Cloudfront now supports a minimum TTL of 0.
Amazon Developer Guide: Expiration1