Overview
This page is the atomic definition. Framework-specific SSG patterns live at astro and 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. 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 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 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
- ssr - server-renders per request; better for dynamic, personalized content.
- isr - extends SSG with incremental background regeneration.
- csr - renders in the browser; no build-time HTML.
- hydration - attaches JavaScript to SSG-generated HTML when interactivity is needed.
- web-vitals - SSG maximizes LCP by delivering pre-built HTML from the edge.
Citing this term
See SSG (llmbestpractices.com/glossary/ssg).