So what've you been up to for the past, oh, seven years or so

3/28/19

Long long ago, in the dark ages of the web, when people still had personal websites and social networks were considered a side dish instead of the main course, I had a blog.

Instead of using an off the shelf content management system for my blog, I decided to home-roll my own -- because the standard stuff wouldn't have perfectly met my specific special snowflake requirements, and because I had vague hopes of maybe turning it into a Real Product that I could someday Do Something Real with.

It was built on the latest and greatest technology: a collection of perl scripts (yes, I did say the dark ages of the web) connected to a MySQL database -- pretty standard stuff, really; the only innovation, such as it was, was that I'd figured out what felt like a pretty nifty, and for my purposes totally over-engineered cache mechanism: the server was set up to deliver static web pages, but if it got a request for a page that didn't exist, instead of returning a 404 error it would call one of those perl scripts to see if that page was supposed to exist. If so, it'd generate it and send it to the user, and then store the rendered result inside the web root so it'd be ready for the next person who requested the same page. If I wanted to redesign or rearrange anything, all I had to do was erase everything in the web root, so the scripts would generate new versions as needed.

In other words, I'd invented a primitive form of what's now known as SSR, "Server Side Rendering" -- using a script to generate pages on the fly takes a little bit longer than just handing out an already-rendered static page, so with this setup only the first person to view a given page would have to wait for the render; everyone else would get results instantly. Which, if this site had ever had more than the couple dozen visitors per day it usually received, might even have been worth the effort!

But it was cool, and I'd made it myself, and it worked, and for a number of years things went humming along smoothly. And then that cache mechanism turned out to be useful in a different way.

Because at some point in there I got busy with work, and let the blog lie fallow for a while -- as you do -- and then at some other point the cheapo fly-by-night operation I was using for web hosting demonstrated the whole "you get what you pay for" thing by going offline for a week or so, and so I migrated over the site to a new host, watched the old one go out of business and disappear a couple weeks later, and went back to work and forgot all about it for a while.

And then at some point later on, I finally went to post something new on the site, and realized that in the process of migrating hosts I'd, oh, you know, sort of forgotten to bring the database along with it; all I had was those static-rendered copies of the pages, and the perl scripts that would be able to generate more if they had a database to talk to.

Oops.

And reconstructing that was going to be a Bit Of A Job; I'd have to set up a new database and scrape the text out of the pages and remember the Apache configuration I'd used to redirect 404s to the perl scripts and etc., and I was in the middle of a real job and didn't have time for such things, and anyway most people seemed to be reading Facebook instead of blogs these days, and my perl skills were getting pretty rusty by then because, well, perl; and... yeah.

So for the past six years I've been letting this site be a public demonstration of my skills circa 2012, i.e. Infinity Years Ago in web time; and have leaked all my google juice. (I used to be neck and neck for the first google result for my name -- it was between me an a German guy with a model car collection. Now I'm nowhere to be found, it's all about this bald mormon singer-songwriter guy. Oh well.)

But I've done it at last! I've moved to a totally standard off-the-shelf CMS so that if anything ever goes wrong I can just call tech support and... ha ha, no, I totally lied. I used a half-built ElectronJS product prototype I was building for some other purpose entirely to scrape the text out of the old pages, dropped that into Firebase Cloudstore, and built a home-rolled special snowflake CMS out of the latest and greatest technology (JavaScript, not perl, this time). Then I realized that Firebase Cloudstore was going to be really expensive so migrated that back down to a, uh, MySQL database, with a little PHP glue sitting in between. (Saved about a megabyte of page weight in the process, too.)

Don't worry, though, it's going to be fine! It all works by generating static pre-rendered pages, so I'll be able to do this again in 2026.