Still a work in progress, but here is what I have:
# 24 hours
Let’s run down the options to the sync command:
- --nopreserve: disable save of filesystem attributes in s3 metadata
- --cf-invalidate: invalidate the uploaded file[s] in Cloudfront
- --add-header=…: explicitly set the cache control headers on the uploaded files
Followed by 4 explicit modify statements to set a shorter max-age on my RSS feed and index pages.
I had previously planned to control my Cloudfront cache behavior via the underlying s3 Cache-Control header. After reflection, I realized this wasn’t my best choice. I want a short Cache-Control max-age to instruct browsers to check for new content. But I want Cloudfront to cache files as long as possible.
My current plan is to use the Minimum TTL in Cloudfront to control the Cloudfront cache behavior and use the Cache-Control header to control browser cache behavior.
17 Oct: s3cmd Revisited x2