modern-react-spa

Chapter 22

The SSG Spectrum

Pure SPA, SSG, SSR, ISR — the rendering spectrum for React in 2026, and how to pick per-page based on SEO, TTI, build time, and data dynamism.

Published 2026-05-23

🎯 Chapter Goal — After this chapter you can place any rendering strategy (pure SPA, SSG, SSR, ISR) on a clear taxonomy, and pick the right one for a given page based on SEO, TTI, build time, and data dynamism.

🧭 Prerequisites — None.


🔹 22.1 Four strategies, clearly

┌──────────────────────────────────────────────────────────────────────────┐
│ STRATEGY     │ HTML BUILT WHEN?            │ JS HYDRATES?  │ TYPICAL    │
├──────────────┼─────────────────────────────┼───────────────┼────────────┤
│ SPA          │ At deploy (empty shell)     │ Yes, on load  │ App        │
│ SSG          │ At build (full HTML)        │ Yes, on load  │ Docs, blog │
│ SSR          │ At request (per request)    │ Yes, on load  │ Marketplace│
│ ISR          │ At build + revalidation     │ Yes, on load  │ E-commerce │
└──────────────────────────────────────────────────────────────────────────┘

SPA (Single-Page App)index.html is a near-empty shell pointing at a JS bundle. The browser downloads the JS; React renders the app; data fetches happen client-side. What this book is mostly about.

SSG (Static Site Generation) — every page is HTML produced at build time. The browser gets fully-rendered HTML; React hydrates afterward to add interactivity. Best for content that doesn’t change per request.

SSR (Server-Side Rendering) — every request renders HTML on the server, then ships it. The browser sees content faster than SPA (no JS-to-render gap), but the server does work per request. Best for content that depends on the request (user, geo, A/B test).

ISR (Incremental Static Regeneration) — start with SSG, but the server can re-render a page on a stale-while-revalidate basis. Best for “mostly static, occasionally updates” — product pages, blog posts.


🔹 22.2 Decision matrix

ConcernSPASSGSSRISR
SEOWeak (crawlers see empty shell)ExcellentExcellentExcellent
TTI (first byte → interactive)Slow (full JS download + render)Fast (HTML + small hydrate)FastFast
Build timeFastSlow (renders every page)N/AMedium
Per-request costTiny (static)Tiny (static)High (renders)Low (mostly cached)
Dynamic dataEasy (client fetch)Hard (build-time only)EasyModerate
Authed contentTrivialImpossible (it’s public)TrivialImpossible (it’s cached)
CDN-friendlyYes (one HTML, JS chunks)Yes (every page)No (per-request)Yes (cached)
Developer mental modelSimple (one app)Medium (build pipeline)Complex (server)Complex

Picking by page type

PageBest strategyWhy
Marketing homepageSSGSEO + TTI; content rarely changes
Pricing pageSSGSame; rebuild on pricing change
DocsSSGSame
BlogSSG (or ISR for frequent updates)Same
Product listing (e-commerce)ISRMostly static, occasionally updates
Product detail pageISRSame
Search resultsSSR (or client-side)Per-request; can’t be pre-rendered
User dashboardSPAAuth-gated; per-user content
Admin toolSPAAuth-gated; complex interactions
Real-time monitoringSPALive data; WebSocket

The honest hybrid pattern

Most real products mix strategies:

  • Marketing / docs site under / — SSG.
  • Customer SPA under /app/* — SPA.
  • Per-request widget (search, recommendations) — SSR via edge function.

Part 6 covers the tools (Ch 23) and the hybrid wiring (Ch 24).


🪤 Common Pitfalls

  1. SSG for authenticated content — you’ve shipped public HTML of private data.
  2. SSR for a 200-page docs site — every request renders; CDN can’t cache; you’re paying for static work.
  3. SPA for a marketing page — Google sees an empty page until JS runs; SEO suffers.
  4. ISR for content that needs to be instantly fresh — revalidation has a window.
  5. Picking strategy by team familiarity rather than page needs — “we know React, so SPA for everything” misses real SEO/perf wins on the marketing surface.

✅ Recap

  • Four strategies; the right choice is per-page, not per-app.
  • SPA for auth-gated dynamic apps; SSG for content; SSR for per-request; ISR for “mostly static.”
  • Real products are hybrid. Ch 24 shows the wiring.

🔗 Further Reading

  • Patrick Lee Scott — “The four rendering strategies” canonical post.
  • Vercel / Cloudflare docs on each strategy.
  • Ch 23 (SSG tools); Ch 24 (hybrid).

In the book — not on the site

Each topic has an 🧠 Under-the-hood subsection — the algorithm, the data structures, what React DevTools surfaces, debugging recipes. Plus a 🧪 hands-on lab per chapter with a starter repo. Reserved for the book.

Topics in this chapter (2)
  1. 22.1 Four strategies, clearly
  2. 22.2 Decision matrix