2 min read
Why I moved my blog to a static site
A database-backed blog cost me money, time and two security scares. A folder of HTML files costs nothing and has not broken once.
For six years my blog ran on a hosted CMS. It worked, mostly. Then the bill went up, a plugin I relied on stopped getting updates, and I spent a Sunday restoring the database after a bad upgrade. That was the week I started moving it to a static site.
What "static" means here
A static site is a folder of finished HTML files. A program called a static site generator builds that folder from your writing, once, on your own machine or on a build server. When a reader asks for a page, the host sends the file that is already there. Nothing is assembled per visit, so there is nothing to crash per visit.
The generator I use is Eleventy. Others like Hugo, Jekyll and Astro work the same way. The choice matters less than people think. What matters is that the output is plain files you can move anywhere.
What I gained
It costs nothing to host. GitHub Pages, Netlify, Cloudflare Pages and Vercel all serve a small static site for free. My old host charged twelve dollars a month for the same traffic.
It is fast without trying. There is no database query and no server-side rendering between the reader and the page. The home page of this blog is under 20 KB, and it loads in well under a second on a slow phone connection.
There is less to attack. No login page, no admin panel, no plugin with a known hole. The worst thing someone can do is read the posts, which is the point.
The writing is mine. Every post is a Markdown file in a git repository. I can read them with any text editor, search them with grep, and keep them long after any particular tool is gone.
What I gave up
Some things need extra work on a static site. Comments need a third-party service or a mailing address. Search needs an index built at build time. A contact form needs a form service. None of these were hard to add, but they are not free in the way a CMS makes them feel free.
The other cost is the build step. You change a file, then the site has to be rebuilt and uploaded. In practice a push to GitHub does both in under a minute, so I no longer notice it.
Would I do it again
Yes. The site has been on a static host for over a year. It has not gone down, it has not needed an update, and it has not cost anything. The time I used to spend on maintenance now goes into writing, which was the reason I had a blog in the first place.