foundation

SSG

Pre-render stable pages at build time for fast delivery, CDN caching, and predictable output.

Static Site Generation pre-renders pages at build time into HTML assets served from CDN or static hosting. Stable marketing docs, blogs with known slugs, and legal pages are classic fits when content changes only on deploy.

App Router: default static behavior when routes do not read request-specific signals. `generateStaticParams` enumerates dynamic paths for build output.

On interviews: explain build-time data fetching, deploy invalidation, and when static output is wrong for personalized dashboards.

Common pitfalls: baking user-specific data into static pages, huge build times from unbounded paths, and forgetting that static still needs security review for client bundles.

The trade-off is unbeatable edge latency versus stale content until rebuild or ISR.

Checklist:

  • Confirm content is identical for all users.
  • Bound generateStaticParams catalogs.
  • Pair with ISR when occasional freshness is needed.
  • Verify client bundles expose no secrets.