Pelican + S3 + CloudFront

Messing around a bit more with this blog - I shifted the main portion of it to CloudFront instead of vanilla S3. The advantage to that being that the free tier gives you a good bit more bandwidth, assuming things are accessed often enough to take advantage of CloudFront’s cache (otherwise they’re just pinged off S3 as per usual).

I also installed the “neighbours” plugin for Pelican, and added appropriate links to the metadata template, which also allows me to stretch the map down about another 15 pixels.

Setting up CloudFront is decidedly non-trivial for someone not well versed in AWS. For some reason it wasn’t immediately obvious that I had to add www.fwaggle.org as a CNAME in CloudFront as well, but the behaviour of pulling from an S3 bucket is terrible - it only respects index.html in the very root of the domain!

It turns out there’s a really simple, if not entirely elegant solution to this.

Now for the good stuff: CloudFront gives greater control over things like custom error pages (which were almost entirely ineffective on S3 in my experience, for seemingly the same problem as the index stuff when pulling directly from the bucket on CF was!), and it seems like the pages load faster depending on where you are because CF is a full CDN instead of just a single-location bucket.

I’ll just have to keep an eye on the costs, as I don’t particularly want to spend a heap hosting this blog.

Horsham, VIC fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC

Navigation: Older Entry Newer Entry