← All writing

A static site is a good default

Most sites do not need a database, a server, or a runtime. Starting from static files is not a limitation — it is a decision you can revisit later.

  • web
  • architecture

Every few years I rebuild my personal site, and every time I am tempted to make it dynamic. A CMS. A database. Some server-side rendering so I can do real things. Every time, I regret it, and every time I go back to generating HTML files at build time.

This is not nostalgia for the early web. It is a response to what most sites actually do.

What a site needs

A portfolio needs to show a list of projects and a few pages. A blog needs dated posts, an index, and a feed. An about page needs text. None of that is stateful. None of that needs a request handler.

Static generation gives you:

  • Speed. HTML from a CDN, usually in under 100ms, from a location near the reader.
  • Security. No server process, no database, no session handling, no attack surface beyond your build.
  • Durability. The output is a folder of files. It will still work in a decade.
  • Cost. Free on almost every static host, and cheap on the rest.

The trade-off is that content updates require a build. For a personal site, that is a feature: publishing becomes a commit, and a commit is reviewable, reversible, and backed up.

The parts people forget

Static does not mean primitive. You can still have a search index, a comment system, and analytics:

  • Search can be a pre-built JSON index loaded on demand, or a small client-side indexer. For a few hundred pages, this is a few dozen kilobytes.
  • Comments can be a third-party embed or, often better, email. The web existed before comment sections and it was fine.
  • Analytics can be aggregate and cookie-free. You probably need less data than you think.

What you lose is per-request personalization. Most sites do not have any, and the ones that do usually want to keep their static pages static anyway.

When to reach for a server

Be honest about the exceptions:

  • You have user accounts with private data.
  • You need real-time collaboration or feeds.
  • You accept form submissions that cannot go to a third party.
  • You have tens of thousands of pages and builds are too slow. (Consider incremental builds before a server.)

Even then, the default is usually “static pages plus a small API”, not “everything rendered per request”.

The decision you can revisit

The strongest argument for static is not that dynamic sites are bad. It is that the static decision is cheap to reverse. Moving from static files to a server is straightforward. Moving from a bespoke server and database back to static files is a rewrite.

Start with the simplest thing that publishes. Keep a build command. If a genuine requirement appears, add exactly the amount of server that requirement demands — not an entire application framework in anticipation of one.