Fine-tuning caching for S3-hosted static blogs using AWS CLI
Because the blogging system that I use doesn’t apply finely grained object-level caching rules, I end up with objects such as images that cache appropriately but an index.html
page that does not. I don’t want client browsers to hang on to the main index.html
page for more than an hour or so because it should update much more frequently than that as its content changes.
It’s possible that I could dig around under the hood of hexo and create a version that applies customized caching rules. Instead, I make a second pass over the content, adjusting the Cache-Control and other metadata according to my needs. For this task I use the Amazon Web Services command line interface AWS-CLI.