# SSG

*Static site generation*

Static site generation builds every page into a finished HTML file before anyone visits, so a request is answered by a file server instead of by code, a database query and a template rendered on the spot.

**Canonical:** https://spoko.space/glossary/ssg/  
**Language:** en  
**Category:** Technology  
**Also known as:** static site generator, prerendering, static build  
**Published:** 2026-09-22  
**Glossary:** https://spoko.space/glossary/

---
## What it is {#what-it-is}

Two ways to produce a page. A **dynamic** site assembles it when the request arrives: PHP wakes up, queries a database, fills a template, returns the result. A **static** site did all of that once, at build time, and left an HTML file on disk. The visitor gets the file.

That is the whole idea. Everything else — Astro, Hugo, Eleventy, Next in export mode — is a different way of running the same build.

## Why it matters if you are paying for a website {#why-it-matters-if-you-are-paying-for-a-website}

Three consequences, in the order they show up on an invoice.

**Speed you do not have to maintain.** There is no origin work to be slow. The first byte arrives from a CDN edge, and the performance work that remains is about images and fonts, not about caching plugins.

**A much smaller attack surface.** There is no database to inject into and no admin panel on a public URL. Most of what I clean up on hacked WordPress sites arrives through an outdated plugin — a route that does not exist when the server only hands out files.

**Hosting that rounds to nothing.** This site runs on a free Cloudflare Pages tier and would continue to do so under traffic that would need a real server behind WordPress.

## What it costs, honestly {#what-it-costs-honestly}

A rebuild per change. Publish a correction and the site regenerates — seconds for a small site, and for this one a few minutes, because the build also renders a social card per page in a headless browser and runs its own link, schema and mirror checks. That is a fine trade for a site with 100 pages and a poor one for a catalogue with 100,000, where you would prerender the templates and fetch the rest at the edge.

The second cost is that anything genuinely dynamic — a cart, a logged-in view, a live inventory count — has to come from somewhere else: an API call from the browser, or a route you deliberately leave rendering on demand. That is a normal architecture, not a defeat, but it is a decision you make rather than one the CMS makes for you.

## What SSG does not mean {#what-ssg-does-not-mean}

It does not mean the site cannot be edited by a non-developer. Editing happens in a CMS or in the repository; the build is what turns either into files. Plenty of static sites keep WordPress as the editor and use it only as an API.

It also does not mean "no JavaScript". Static describes when the HTML is produced, not what runs afterwards. A static page can carry as much client-side code as you like — which is precisely how a static site ends up slow anyway.

## Related terms {#related-terms}

- [Astro](https://spoko.space/glossary/astro/): Astro is a web framework that renders pages to HTML at build time and ships no JavaScript unless a component asks for it. Interactive pieces are declared one by one as islands, so a page carries the code for those and nothing else. — Markdown: https://spoko.space/glossary/astro.md
- [headless CMS](https://spoko.space/glossary/headless-cms/): A headless CMS stores and edits content but does not render the website. The pages are built by something else, which reads the content over an API — so the editing tools and the front end can be changed independently of each other. — Markdown: https://spoko.space/glossary/headless-cms.md
- [Core Web Vitals](https://spoko.space/glossary/core-web-vitals/): Core Web Vitals are the three metrics Google collects from real Chrome visits: LCP for loading, INP for responsiveness and CLS for visual stability. A URL passes when 75% of its visits are inside the good threshold. — Markdown: https://spoko.space/glossary/core-web-vitals.md
- [CMS](https://spoko.space/glossary/cms/): A CMS is the software that lets someone change a website without touching code. The word covers three separate jobs — editing, storing and displaying content — and most arguments about which CMS to use are really arguments about which of the three you need. — Markdown: https://spoko.space/glossary/cms.md

## Where I write about this {#related-posts}

- [Web Application Frameworks in 2026](https://spoko.space/blog/web-application-frameworks-2026/) — Markdown: https://spoko.space/blog/web-application-frameworks-2026.md
  Astro, Vue, React, Next.js or headless WordPress? A practical comparison of the popular frameworks with performance benchmarks and usage scenarios.
- [AEO — How to Optimize Your Website for AI and Answer Engines](https://spoko.space/blog/aeo-answer-engine-optimization/) — Markdown: https://spoko.space/blog/aeo-answer-engine-optimization.md
  Answer Engine Optimization, llms.txt, islands architecture, and speed as conversion currency. A practical guide to optimizing websites for language models and generative search.
- [Parts & Accessories Catalog](https://spoko.space/vw-polo-6r-parts-catalog/) — Markdown: https://spoko.space/vw-polo-6r-parts-catalog.md
  Headless CMS parts catalog for VW Polo 6R. Astro SSG, Vue 3, Laravel API, Filament admin, AI descriptions, DeepL translations and Cloudflare R2 image pipeline.
- [Multilingual Corporate Website for an Aluminium Profiles Manufacturer](https://spoko.space/profile/) — Markdown: https://spoko.space/profile.md
  Multilingual corporate website showcasing Grupa Kęty's Extruded Products Segment — aluminum profiles, products and services.

## See also {#see-also}

- [Web development](https://spoko.space/web-development/)
- [Moving a site off WordPress to Astro](https://spoko.space/wordpress-to-astro/)

## Sources {#sources}

- [Rendering on the Web](https://web.dev/articles/rendering-on-the-web) — The reference taxonomy: static, server, client and the hybrids between them.
- [Astro — rendering modes](https://docs.astro.build/en/basics/rendering-modes/) — How one framework draws the line between prerendered and on-demand routes.
