Speeding up the site a bit more
Home - Texts - Speeding up the site a bit more

Speedy Serving from Anemic Anatomy

My “server” for this site is still the $10 old Raspberty Pi. Since it is static, it’s not much of a drain on the CPU and thus very much usable. Pictures are currently hosted locally, largely because that’s how I implemented all the responsive stuff, but there’s a change this might change in the future[1].

However, there are a few smaller things I could do, caching and deferred scripts aside, to speed up the site a very slight bit more.

First, ufw and a massive blocklist of spammers and script-kiddies trying to exploit WordPress and other weaknesses. Over 75% of my daily visits aren’t humans but vulnerability scanners. Reducing the overall server load by that much, that’d be amazing. I implemented it, instantly saw an avalanche of DENY messages scroll down my firewall log, got scared I’d blocked too much, and realized that, no, I had not. Those were all scanbots. Scary? Only if you don’t run a static text website.

Secondly, a few conditionals. By making the inclusions of admonition and image shortcode CSS and JavaScript conditional on the actual use of those features, I dropped my data volume and page load times even more. Not to mention much less parallel HTTPS requests, which is the main bottleneck on this site.

And then I had a friend pull out the SD card from the Pi, dump it into an image, and write this image onto the fastest 512 GB SD Card we could find, a Sandisk Extreme. And while this totally violates my “no server over $25” rule, after all I had to shell out $49 for it, it was worth it.

lighthouse https://mikka.md --view --chrome-flags="--headless" now returns this:

Mission Accomplished
Mission Accomplished

Footnotes:

  1. I am a bit scared to try this, but technically I could mount the Object Storage into the blog directory with s3fs and return the URL of the Object Storage instead of the local directory. For this, eleventy-image would write into what it presumes to be a local folder, which in truth is a mounted Object Storage bucket at Linode… sigh, I’ll experiment. ↩︎