I am a Static Site Hipster

25 January 2023

I want to give myself a little credit here.

In January 2008, I released a Python library called staticgenerator which acted as a static-content cache for Django. The idea was that you'd set URL paths you want to cache (e.g. a blog post), and when those pages are requested the first time, staticgenerator would save the result to the filesystem. If configured as suggested, subsequent requests would be served by that file and avoid talking to the Django app altogether.

My blog at the time (superjared.com) was a custom Django app that used staticgenerator as described above. There were a few instances where a post would be slashdotted or hacker news'd and my Slice (RIP Slicehost) was able to handle it just fine because all nginx would have to do is serve the file, which is something that, by utilizing kernel page caching and sendfile(), is extremely efficient. So efficient, in fact, that the rate of requests my site could handle was an order of magnitude higher than with standard Django caching.

This was the chart I used in the staticgenerator documentation:

Chart describing staticgenerator performance

Approximately 100 requests per second for the app, 500 req/s when using Django caching[1], and 7,000 req/s when using staticgenerator. If these numbers seem small, remember this is 2008 and it was tested on a $20/mo VPS from Slicehost that has all of 256MB of memory.

What I liked about my blog setup was that I could have the best of both worlds. I used Django's admin interface to administer my blog, add posts, moderate comments, etc. But I could trust that if I had a spike in traffic that my Django app was not affected.

Unfortunately for me, it didn't really catch on. I don't think I explained or sold it well.

Enter Tom Preston-Werner

In November of the same year (10 months after I released staticgenerator, but who's counting?), everbody's second-favorite Tom[2] wrote a post called Blogging Like a Hacker, in which he announced his own static site generator, Jekyll.

Jekyll is a simple, blog aware, static site generator. It takes a template directory (representing the raw form of a website), runs it through Textile and Liquid converters, and spits out a complete, static website suitable for serving with Apache or your favorite web server.

Jekyll was substantially different from staticgenerator because it was used locally, and the changes are pushed as static files to a web server. The setup is considerably simpler, too. You don't need to deploy anything but the generated files.

TPW had a number of things going for him. As a founder of Github, he was well known. He has the ability to describe technical challenges and their solutions to a large audience.

I've been living with Jekyll for just over a month now. I love it. Driving the development of Jekyll based on the needs of my blog has been very rewarding. I can edit my posts in TextMate, giving me automatic and competent spell checking. I have immediate and first class access to the CSS and page templates. Everything is backed up on GitHub. I feel a lightness now when I'm writing a post. The system is simple enough that I can keep the entire conversion process in my head. The distance from my brain to my blog has shrunk, and, in the end, I think that will make me a better author.

TPW made a good product, released it to the world, passionately described its use case, and eventually made GitHub support it with their GitHub Pages product. It was a no-brainer.

I made a good product, but it required a lot of setup by the user: integration into their Django app, configuration, deployment. Lots of things that could go wrong. I passionately described its use case but the target user base were people blogging or creating websites with Django. The limited scope, limited audience, and my limited influence meant that staticgenerator was bound for obscurity.

Like anything, it was a learning experience

I'm still proud of my project. It was fun to write, useful for me personally, and I learned a lot in the process. Just because it didn't gain much traction doesn't mean it wasn't worth doing.

So if I have a moral to this story: go write something even if you don't think anyone but you will use it. Maybe they will, maybe they won't. But at the end of the day you will probably get something out of it.

Epilogue

It's 2023, and I've created a new blog. This time I'm using a static site generator called Zola.

Footnotes