Kev Quirk and Horst Gutmann recently wrote about how much it cost them to run their blogs. So I thought, I could write about it too.
To answer the question from an anonymous reader:
Any reason why you’re using a paid CDN for a personal website and not a free one like Cloudflare?
I still use Cloudflare, but only as a registrar for a few domains and for the DNS management (which I do by code lately). (I have not yet found a better alternative to Cloudflare for this.)
As a CDN I use BunnyCDN (alternatively here is my referral link), firstly because I don’t like how Cloudflare makes Tor users’ browsing so difficult, but also because BunnyCDN gives me more flexibility (with edge rules and all the other features - like the cloud storage which I use for media files on my blog), it’s an European company and it’s more sustainable if I pay for the services I use myself.
Yesterday and today I worked very hard on making my blog faster. In the Google Search Console I saw that my blog suddenly gets half as many clicks since a few days and that my pages are only “moderately” fast. I don’t really care about the number of clicks, but I do want the site to be fast. PageSpeed Insights also showed me that the time until the “First Contentful Paint” seems to be longer than a second for many users (and it has to be under a second for it to be considered fast).
I use BunnyCDN as storage for my Micropub media endpoint, where I upload all the photos and other media files I publish on my blog. When I upload a new photo the media endpoint first uploads the original file with the name of it’s SHA-256 hash value (so when I upload the same file multiple times, it doesn’t create multiple files). When I upload an image (JPEG or PNG) it also gets optimized and resized to a maximum width of 2000 pixels using the Tinify API (and then uploaded to BunnyCDN too), doing that significantly reduces the file size of the images displayed on my blog.
Tinify or TinyPNG or TinyJPEG is the service I use to automatically compress and resize images uploaded to my micropub media endpoint. It’s a great service with a nice developer API that also offers a free limit of 500 compressions per month and has a pay-what-you-use policy after that (but I won’t upload more than 500 images per month anyway). I use a library written in Go to use the API.
🖼️ Read more
The great thing about my custom Micropub endpoint for Hugo is, that I can add all the features I need.
Today I added a feature, that purges the BunnyCDN cache 10 seconds after a new entry got published. Sometimes it happens that I open its URL before the Hugo build is finished and then a 404 page gets cached. Currently Hugo needs around three seconds to build my blog (on the server, on my desktop PC it’s even faster).