# Static generation (SSG)

> Rendering pages to HTML at build time, so a request is answered by handing over a file instead of running code.

Nothing is faster than a file that already exists. A statically generated page can be served from an edge location near the visitor, cached indefinitely, and does not fall over when traffic arrives, because serving it costs almost nothing. For content that is the same for everybody — marketing pages, documentation, case studies — there is rarely a good reason to render it per request.

The constraint is that the content has to be known at build time. Anything genuinely per-request — a logged-in dashboard, a live price, search results — cannot be static, and the useful architecture is usually a static shell with the dynamic part fetched separately, rather than making the whole page dynamic to accommodate one component.

## Related terms

- https://dfieldsolutions.com/en/glossary/hydration.md
- https://dfieldsolutions.com/en/glossary/core-web-vitals.md
- https://dfieldsolutions.com/en/glossary/lcp.md

---

Source: https://dfieldsolutions.com/en/glossary/static-generation
DField Solutions — Dunakeszi, Hungary — dezso@dfieldsolutions.com
Booking: see https://dfieldsolutions.com/en/contact
