Static no longer
I've gone and done it. I took my nice, static site and turned it dynamic. Wow, what a headache.
I’ve been wanting to add comments to Thudfactor for months. I spent an entire weekend on it earlier this year only to discover that I couldn’t actually do it while hosting through Cloudflare — something something node, something something edge requests. There’s nothing quite like the feeling of assembling a small dynamic feature out of several tutorials then debugging it for hours only to find that your hosting environment just won’t do it.
Anyway, so I moved over to Vercel. The initial move was more complicated than I anticipated because I’d converted this site to be dynamically generated on Cloudflare and I couldn’t just pick it up and move it to Vercel. So back to static it went.
I use Astro to run this site. I love it. As a static website there was no database, no server-running code. The deployed version of Thudfactor was just HTML, CSS, and the occasional bit of JavaScript. The problem with static sites is that any change requires a re-deployment, so comments either require integration of a client-side JavaScript-only solution or turning this site dynamic. I opted for the latter.
Now I have a database, code to keep secure (this is not a dare), and a cache invalidation problem. Cache invalidation is famously one of several dozen “two hard things” in computer science.
Anyway, after much frustration caused by requiring “adapters” to do on-demand builds in two different environments as well as learning what the same features are called in those environments (“naming things” is also one of the “two hard problems”), and I feel like I have my own tiny AWS setup in miniature. Which is probably not far from the truth.
Vercel does provide several value-adds over Amazon, including me not having $0.025333… billed to my card every month because there’s an AWS service somewhere that I can’t find and have forgotten the name of and thus can’t cancel.
I also began to understand the appeal of AI coding assistants at this point. Hooking up MCP servers to the documentation of Astro, Vercel, and my database provider helped a great deal because search engines are now awful and I also don’t want to memorize a ton of bespoke vocabulary for the services of three different vendors. So yeah, AI certainly sped things along here.
But at last I have a form that will no doubt earn me tons of spam. Which will be offset by the slow realization that no one feels a need to comment on this blog.
(That one is a dare.)
Add a comment