SSG stands for Static Site Generation: pre-rendering every page of your site at build time, then serving the resulting HTML files from a CDN. The opposite of SSR (server-side rendering on each request) and CSR (client-side rendering in the browser).
Why it matters
SSG pages are the fastest, cheapest, and most reliable kind of page on the web. There’s no server to crash, no database to query at request time, and no inference latency. They scale to infinity for pennies.
Common mistakes
- Using SSG for content that changes per user. SSG can’t personalize. If you need per-user content, mix in SSR or client-side fetches.
- Skipping ISR or revalidation. Pure SSG is "rebuild to update." Modern frameworks (Next.js, Astro) offer Incremental Static Regeneration so you can refresh stale pages without a full deploy.
- Treating "JSON file as DB" as SSG. SSG sites can absolutely have a real database; they just consume it at build, not at request.