Recently my fzf
post went really, really viral on Hacker
News! This touched off a
virtuous cycle where I was also featured in the TL;DR
Newsletter, which I’m pretty sure is
AI-generated? I digress. This was an exciting thing to see, except for the fact
that Netlify is now banging on my door asking me for $110 in surprise bandwidth
costs.
Yeah, yeah, I know. Nobody expects the SaaS Inquisition. I humbly submit tht, as an ops guy, I should know better than anyone to keep things as braindead as possible - and Netlify is an absolutely, delightfully braindead option for me. Hook it to a Git repo, tell it it’s time to build, and relax. Since the median website has precisely 0 viral posts, I defend my choice to go with the smartest tool in my collection, and only go dumber – and cheaper – when a real business case is presented to me.
Well, here’s the business case. So I thought over what lessons I took from this:
-
Bandwidth is critical. Bandwidth is why Netlify charged me an arm and a leg for my blog post, so cheap bandwidth is what I should optimize for.
-
Builds are not. I already use a shell script and a cron job locally to auto-commit and push to Github. Is it really that much extra effort to just build locally and
rclone
over to some S3 bucket or storage account? -
Optimize your GIFs! All the comments asking “Why didn’t you use ASCIInema” were wrong and silly because I didn’t want to depend on a third party! Except… Even if I didn’t want to include the necessary Javascript, I’ve already eaten the learning curve to learn how to create animated SVGs from ASCIInemas :
That whole thing is only about 125% the size of the largest GIF on that page! The text is even highlightable when you look at the raw image. (Still no ability to replay the loop, sadly.)
With all this in mind, I first tried moving to hosting this site with Azure storage containers. (Why Azure over AWS? It’s what I use at work, and I’m a diehard proponent of specialization of labor.)
But that turned out to be too much for my sleep-dep brain today, so instead I went with Azure Static Web Apps, and – it’s Netlify again! Or more like Netlify with saner bandwidth pricing and saner bandwidth limits. I do think the cost is slightly higher than what I might be able to eke out with a storage container when viral peaks hit, but honestly I’m already making an >50% savings on bandwidth above the first 100 GBs, and it’s not bought in 100-GB chunks, either. I’m quite happy with the results.