Websites and Tech

Static Site Generator

Also called SSG

A tool that renders content and templates into finished HTML files ahead of time, so servers hand over ready-made pages.

Quick facts: Static Site Generator

Category
Websites and Tech
Also called
SSG
Level
Advanced
Affects
Loading speed, hosting cost, security, publishing workflow
Where to see it
Astro, Hugo, Eleventy, Jekyll, Next.js static export
In this article4
  1. How a static site generator works
  2. Why it matters
  3. Where the approach strains
  4. How to decide

How a static site generator works

Most websites build each page at the moment it is requested: the server runs code, queries a database, assembles the HTML and sends it. A static site generator does that work in advance. It takes your content and templates, renders every page into a finished HTML file, and those files are what gets uploaded. When a visitor arrives, the server hands over a file that already exists.

The content usually comes from text files in a repository or from a headless CMS. A build runs whenever content or code changes, and the output is published. Astro, Hugo, Eleventy, Jekyll and the static output modes of Next.js and Nuxt all follow this pattern.

Why it matters

Speed is the obvious gain. There is no database query and no code execution between the request and the response, so pages arrive quickly and stay quick under load. Because the files are just files, they can be pushed to a content delivery network and served close to the visitor, which is a genuine benefit for a Nepali business selling to Australia or the UK.

Security improves for the same reason. There is no database to inject into and no admin login on the public site, so the most common ways a small business site is compromised simply are not present. Hosting is cheap, and a site that has been quiet for months does not degrade the way an unpatched dynamic site does.

Where the approach strains

Anything genuinely dynamic has to come from somewhere else. Search, comments, carts, logins, personalised prices and live stock all need a separate service called from the browser, so the promise of simplicity fades once a site has real commercial features.

Editing is the second strain. Unless a friendly content system is connected, publishing means committing a file and waiting for a build, which is fine for developers and unworkable for a marketing team. On large sites the build itself becomes the bottleneck, since a small correction can trigger a rebuild of everything. And a routine content edit is no longer instant — the change is live only after the build finishes, which surprises clients used to pressing Update.

How to decide

A static generator suits documentation, guides, brochure sites, campaign microsites and content-heavy sites that change on a predictable rhythm. It suits teams who are comfortable with a repository, or teams given a proper editing interface on top.

It suits less well a site whose staff publish several times a day, a shop with changing stock, or a business with nobody to run the build pipeline. If you choose it, connect an editing interface the team will actually use, keep the redirect rules and sitemap in the build so they cannot be forgotten, and treat the build process as infrastructure someone must maintain. Where speed alone is the goal, caching an existing dynamic site is usually the cheaper route, and that is the first thing I look at in page speed optimisation.

Do and do not

Do

  • Give editors an interface they will actually use
  • Keep redirects and the sitemap inside the build
  • Serve the output from a content delivery network

Do not

  • Choose it for a shop with changing stock
  • Expect content changes to appear instantly
  • Leave the build pipeline with no owner

Questions people ask about this

Is a static site better for SEO?

It helps with the parts SEO cares about most: fast loading, reliable HTML delivered in the first response, and no server errors under load. It does nothing for content quality, links or search intent, which decide rankings. Treat it as removing technical obstacles rather than as an advantage in itself.

Can a static site have a contact form or a blog?

Yes to both. Blog posts are simply pages generated at build time, which is what these tools were designed for. Forms need an external handler, since there is no server-side code on the site; a form service or a small hosted function receives the submission and emails or stores it.

How do content updates get published?

A change to the content triggers a build, and the newly generated files replace the old ones. This is usually automatic once configured. The practical consequence is a delay between saving and seeing the change live, ranging from seconds to several minutes depending on the size of the site.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.