• Skip to primary navigation
  • Skip to main content
  • Skip to footer

lawsie

The long-term storage silo of a human mind

  • Andrew Culture
  • Beat Motel Podcast
  • Observations
  • Consumer Info
  • Tech
  • Music Consumption
  • Musician Stuff
  • Graveyard
  • Buy me a pint
Home » blog » Jekyll site hosted on CloudFront & S3 not updating

Jekyll site hosted on CloudFront & S3 not updating

Published February 23, 2018 by lawsie Leave a Comment

Go to your CloudFront distribution and invalidate the cache

One of the problems that had be really scratching my head when I first starting deploying my Jekyll sites to Amazon S3 was that the buggers didn’t seem to update. I would get the updates I wanted working locally and when I deployed the Jeckyll site to my S3 bucket the public site of the site wouldn’t update.

The Symptom I use the s3_website plugin to deploy to S3 and it’s pretty good with error messages. If a deploy doesn’t work then you’ll get an error message. Simples. What was frustrating was that I was getting no error messages from my S2_website deploys, but the front end of my site wasn’t updating.

The problem I found out that because my Jekyll site is served by Amazon CloudFront the problem was probably related to the CloudFront cache. One of the quirks of CloudFront is that when you update assets in a site (pages, pages, whatever) and don’t change the asset name then CloudFront will pretty much ignore that asset and not distribute it for a while. For example, if you make changes to your Jekyll config file and commit it, then you might not see the changes you’ve made for a while.

The fact CloudFront doesn’t automatically, instantly, purge items from cache when they are updated comes under the category of ‘things I wish I had known before troubleshooting CloudFront.

How to purge the whole CloudFront distribution of your Jekyll

Fortunately clearing the entire cache of your CloudFront facilitated Jekyll site is fairly easy. Go to your distribution in CloudFront, click the tab labelled ‘Invalidations’, then click the ‘Create Invalidation’ button. Next shove a * wildcard character in the box labelled ‘Object Path’, then click the invalidate button at the bottom of the dialogue box.

After a few seconds the status of the Invalidation will show as ‘complete’. Now when you check your front end it should be up to date.

Theoretically Amazon will charge you for purging but only if you purge more than 5,000 times a month! So I shouldn’t worry too much…

If you would like more detailed instructions I recommend you take a look at this guide on ColaWeb

Last Updated on February 23, 2023

Filed Under: jekyll Tagged With: Amazon Hosting Issues, jekyll

Have you found this content useful?

Buy me a pint

This website isn't packed with obnoxious advertising but it does cost money to keep alive. Every little donation is a big help!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Footer

Copyright © 2023 · Site wholly owned by Andrew Laws Associates Ltd | SEO by Yeseo

  • Home
  • About me
  • Andrew Culture
  • Buy me a pint
  • Privacy Policy
  • Contact me