---
title: "SSG (Static Site Generation)"
slug: "ssg"
category: "glossary"
tags: ["glossary", "frontend", "rendering", "performance", "astro", "nextjs", "seo"]
status: "stable"
last_updated: 2026-05-14
summary: "SSG pre-renders all pages to static HTML files at build time, enabling instant delivery from a CDN with no server-side computation per request."
related:
  [
    "[[frontend/astro]]",
    "[[frontend/nextjs]]",
    "[[glossary/ssr]]",
    "[[glossary/isr]]",
    "[[glossary/csr]]",
    "[[glossary/hydration]]",
    "[[glossary/web-vitals]]",
  ]
---

## Overview

This page is the atomic definition. Framework-specific SSG patterns live at [[frontend/astro]] and [[frontend/nextjs]].

## Definition

Static Site Generation (SSG) pre-renders every page to a plain HTML file during the build step. The resulting files are uploaded to a CDN and served directly to browsers with no per-request server computation. Build time scales with page count, not traffic, so high-traffic sites pay no marginal compute cost. SSG is the deployment model for this site (Quartz 4 writing output to `public/`) and for Astro, Hugo, Eleventy, and Gatsby. Next.js supports SSG via `getStaticProps` with `getStaticPaths` for dynamic routes. The limitation is staleness: the site reflects only the data available when the build ran. [[glossary/isr]] extends SSG with time-based revalidation to reduce this window without full server rendering. Content that changes faster than the acceptable rebuild cycle belongs in [[glossary/ssr]] or client-side fetching.

## When it applies

Use SSG for marketing pages, documentation, blogs, and any content that changes on a publishing cadence rather than on every request. SSG delivers the best possible [[glossary/web-vitals]] scores because HTML is served from the CDN edge, eliminating origin latency.

## Example

A documentation site with 500 pages rebuilds on every merge to `main`. The build takes 45 seconds. All pages are served from Cloudflare's edge at sub-10 ms. An author edits a page, merges, and the rebuild publishes the change automatically.

## Related concepts

- [[glossary/ssr]] - server-renders per request; better for dynamic, personalized content.
- [[glossary/isr]] - extends SSG with incremental background regeneration.
- [[glossary/csr]] - renders in the browser; no build-time HTML.
- [[glossary/hydration]] - attaches JavaScript to SSG-generated HTML when interactivity is needed.
- [[glossary/web-vitals]] - SSG maximizes LCP by delivering pre-built HTML from the edge.

## Citing this term

> See [[glossary/ssg|SSG]] (llmbestpractices.com/glossary/ssg).

## Related

- [[frontend/astro]]
- [[frontend/nextjs]]
- [[glossary/ssr]]
- [[glossary/isr]]
- [[glossary/csr]]
- [[glossary/hydration]]
- [[glossary/web-vitals]]
