SSG, ISR, and SSR Patterns with a Headless CMS
Select the optimal rendering strategy per route type to balance build speed, content freshness, personalization, and Core Web Vitals.
Matching Rendering Modes to Route Volatility
Modern meta-frameworks such as Next.js and Nuxt no longer force one global rendering mode across an entire website. Choosing between Static Site Generation (SSG), Incremental Static Regeneration (ISR), and Server-Side Rendering (SSR) per route optimizes both build duration and latency.
Evergreen marketing guides perform well as static pre-rendered HTML, whereas inventory-sensitive catalog pages or user-authenticated dashboards benefit from on-demand ISR or dynamic SSR.
- SSG pre-renders deterministic HTML at build time for maximum edge speed
- On-demand ISR updates individual static pages via CMS publish webhooks
- SSR renders per-request HTML when personalization or cookies dictate output
- Hybrid routing lets teams mix SSG, ISR, and SSR within one codebase
Avoiding the Build-Time Bottleneck
Pure SSG breaks down when a site grows past tens of thousands of localized entries: a single typo fix triggers a 20-minute full-site rebuild and pounds the CMS Delivery API with thousands of concurrent build queries.
On-demand ISR solves this by pre-rendering only top-priority routes during deployment and generating or revalidating long-tail routes lazily on request or via targeted webhook calls.
Preview Mode and Draft Rendering
Static and cached ISR pages cannot serve unpublished editor drafts directly. Frameworks solve this with Draft/Preview Mode cookies that bypass static caches for authenticated editors and query the CMS preview API dynamically via SSR.
Once editors exit preview mode, the cookie clears and normal edge-cached rendering resumes.
- Sign preview redirect URLs with short-lived HMAC tokens to block unauthorized viewing
- Set X-Robots-Tag: noindex on preview responses so drafts never enter search indexes
- Provide a clear floating banner allowing editors to exit preview mode easily
Protecting Core Web Vitals
Regardless of rendering mode, minimize client-side hydration waterfalls by fetching CMS payloads on the server, inlining critical metadata, and reserving explicit image dimensions to maintain zero Cumulative Layout Shift (CLS).
Frontend Rendering Mode Comparison
| Rendering Mode | Time to First Byte | Build Time Scaling | Best Route Fit |
|---|---|---|---|
| Pure SSG | Lowest (edge static HTML) | Degrades above ~10k pages | Docs, legal & core landing pages |
| Timed ISR | Edge static + async refresh | Fast (top routes only) | High-volume blogs & catalogs |
| On-Demand ISR | Edge static + webhook refresh | Fast + instant publish sync | Editorial hubs & product pages |
| Edge / Node SSR | Depends on API + cache hit | Zero static build cost | Personalized or geo-gated views |
| Client Fetch (CSR) | Fast shell, slower LCP | Zero build cost | Authenticated dashboards only |
Avoid client-only CSR for SEO-critical pages; render primary content and JSON-LD on the server or at build time.
Worked Illustration: Hybrid Rendering for a 25,000-Page Portal
Illustrative Next.js configuration preventing slow CI builds while keeping content fresh:
- Pre-render the homepage and top 500 canonical guides via SSG during CI deployment.
- Configure remaining 24,500 regional long-tail routes with on-demand ISR generation on first visit.
- Connect HCMSDXP publish webhooks to /api/revalidate to purge exact updated paths immediately.
- Route /preview/* through SSR with signed draft cookies and X-Robots-Tag: noindex headers.
Worked Outcome: CI deploys finish in under two minutes while every published edit reflects live within seconds.
Headless Frontend Rendering Checklist
- Render SEO headings, body copy, and JSON-LD server-side or statically
- Use on-demand ISR with webhook revalidation for sites exceeding 2,000 pages
- Throttle concurrent CMS API requests during full static builds to avoid 429s
- Protect preview endpoints with signed tokens and X-Robots-Tag: noindex
- Set explicit width/height attributes on CMS images to prevent layout shifts
- Measure TTFB and LCP in synthetic tests across both warm and cold ISR routes
Frequently Asked Questions
Why does client-side rendering hurt headless SEO?
Waiting for browser JavaScript to fetch CMS JSON delays Largest Contentful Paint and risks incomplete rendering by crawlers.
Does ISR require a Node.js server?
ISR relies on a hosting platform or server runtime capable of regenerating and persisting updated HTML/JSON artifacts on demand.
How do you prevent build storms against the CMS API?
Cache shared global queries (like header navigation) across build workers and limit build-time concurrency queues.
When is SSR better than on-demand ISR?
Use SSR when page HTML varies per authenticated user session, A/B cookie, or real-time inventory request.
Primary Standards & Industry References
- W3C Web Performance Working Group — Largest Contentful Paint (LCP) Specification
- Google Web Vitals — Core Web Vitals Thresholds (LCP, INP, CLS)
- IETF RFC 9111 — Shared Edge Caching Semantics for Revalidated Responses