2 min read | Topics: workflow AWS development | Edit post

How I Update My Website

Since I forget what I actually need to do to update this website, figured it would be a nice little post. I set up the workflow for hosting my site by following the cloud resume challenge by Cloud Irregular. I didn't follow the challenge exactly since I didn't really care about the visitor count part (or having to set up dynamoDB for a static site). These are the parts I did implement though:

So most of the workflow for updating the site is automated for me, all I have to worry about is writing posts, updating my resume, and pushing that code to GitHub right? Well, it's almost entirely automated except for one small but important bit...invalidating the CloudFront cache.

The Manual Part of Updating

Since I'm not an expert in AWS or other cloud tech, I wanted to keep things simple where I could. One of the things I could have done is set up object versioning in my S3 bucket. This would have allowed CloudFront to automatically invalidate its cache when new versions of objects in the bucket appeared. Sometimes I push many commits very quickly and sometimes I have to redo commits and other things that would cause many versions of the objects to appear and many invalidations to occur (potentially). I don't want to deal with accidentally occurring fees by using AWS, so I decided that I would manually invalidate the cache when I needed to. Unfortunately, I didn't really write that decision anywhere! 😬

If I recall correctly, CloudFront cache checks my bucket once a day for updates and would invalidate itself if the bucket had changed...but I could be wrong about that. Most cases though when I update something on my website, I want it to appear ASAP. (With this post though, when it appears is when it appears, what's more important is that the post is in GitHub 😂) The way to get this new content to appear, after the GitHub action has successfully deployed to S3, is to manually invalidate the cache.

Cool, so now there's another part of maintaining things that I don't have to remember...just need to remember to view this document 😂

Is there an issue with this post? Think you could clarify, update, or add something? All my posts are available to edit on Github. Any fix, little or large, is appreciated! Edit on Github