# Static Site Generation (SSG)

> Pages are built as HTML files ahead of time. Then no one has to wait.

**Field:** Software Development  
**Category:** Web Development  
**Also known as:** SSG, Static Site Generator, Pre-rendering

## Think of it like

Think of it like printing all the menus before the café opens. No one waits for a menu.

## Definition

Static site generation builds each page as an HTML file ahead of time. This happens before anyone visits. A build step reads the content and templates and writes out the files. The server then just hands out those files, which is very fast and cheap. When the content changes, you run the build again. It suits blogs, docs and any page that is the same for everyone.

## Example

Jack's docs site has 300 pages. A build turns them into HTML files in 20 seconds, and the host serves them for free.

## Why it matters

Pre-built pages are the fastest and cheapest to serve. Nothing can break at request time.

## Common mistake

Using it for pages that change each minute. You would have to rebuild all the time.

## Three principles

- **Built ahead of time.** Before anyone asks.
- **Just files.** Fast, cheap, hard to break.
- **Rebuild to change.** New content means a new build.

## Related terms

- [Static Website](https://learn.benibix.com/term/development/static-website)
- [Server-Side Rendering (SSR)](https://learn.benibix.com/term/development/server-side-rendering)
- [Template Engine](https://learn.benibix.com/term/development/template)
- [Client-Side Rendering (CSR)](https://learn.benibix.com/term/development/client-side-rendering)

## Told apart from

- [Static Site Generation vs Server-Side Rendering](https://learn.benibix.com/compare/ssg-vs-ssr): Both send ready-made HTML. Static site generation builds each page once, ahead of time. Server rendering builds it again for each visit, so it can show fresh data.

---

Source: https://learn.benibix.com/term/development/static-site-generation
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
