<strong>Static Site Generation (SSG)</strong> is when you build all your HTML pages at build time, not at request time. The result is pre-rendered HTML files that load instantly and can be served from a CDN.
The Newspaper Analogy
SSG is like printing newspapersโyou create all copies in advance (build time) and distribute them. Readers get instant access without waiting for printing (rendering).
Printing Press (Build Time)
Print all copies
Newspapers (Static HTML)
Pre-made, ready to read
Delivery (CDN)
Distribute everywhere
Generate All Pages
Pre-rendered Files
Instant Load
Fetch data at build
Query CMS, database, APIs during build
Generate HTML pages
Create static HTML for every page/route
Deploy to CDN
Upload static files to Vercel, Netlify, etc.
User requests page
Served instantly from CDN, no server processing
Rebuild on changes
Trigger new build when content updates
Wrong
"Static sites can't be dynamic or interactive"
Correct
SSG sites can be <strong>highly interactive with JavaScript</strong>. The initial HTML is static, but client-side JS adds interactivity, real-time features, etc.
Documentation site with SSG:
Build generates HTML for all 1000 doc pages
Deployed to CDN (Vercel, Netlify)
Users get instant page loads (no server rendering)
Perfect for blogs, docs, marketing sites