C.W.K.
Stream
Lesson 03 of 08 · published

The Rendering Spectrum

~24 min · SSG, ISR, SSR, CSR, RSC

Level 0Curious
0 XP0/68 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

Static, ISR, SSR, CSR — the spectrum

Web pages live somewhere on a line from "fully static, served from a CDN" to "fully dynamic, rendered per request in JavaScript on the client." Next.js supports the entire spectrum and lets you pick per route or per fetch.

StrategyWhen it's chosenUse cases
SSG (build time)No request-time data, fetches are cachedDocs, blog posts, marketing pages
ISR (revalidate)Static + a revalidate hintProduct pages, news feed, pricing
SSR (per request)Reads cookies(), headers(), searchParamsAuth'd pages, dashboards, search
CSR (browser)Inside a Client Component using stateLive editors, collaborative UI

How Next.js detects which mode you're in

You don't pick a mode by name — you pick it by the APIs you call. Use cookies() or headers() and the route becomes dynamic. Mark a fetch with cache: 'force-cache' and that data point is static. The detection is automatic at build time.

Why this matters before you write a line

Picking the wrong point on the spectrum is how Next.js apps end up either expensive (everything dynamic) or stale (everything static). Decide per route: what changes, how often, who pays the freshness cost.

Code

Static by default·tsx
// app/about/page.tsx
export default async function AboutPage() {
  const text = await fetch('https://api.example.com/about', {
    cache: 'force-cache',
  }).then(r => r.text());
  return <article>{text}</article>;
}
// Rendered once at build time, served as static HTML afterwards.
Dynamic on touch of cookies()·tsx
// app/dashboard/page.tsx
import { cookies } from 'next/headers';

export default async function Dashboard() {
  const session = (await cookies()).get('session'); // <- triggers dynamic
  const data = await fetchUserData(session?.value);
  return <DashboardView data={data} />;
}
// Re-rendered per request because cookies() is request-bound.
Force a route segment one way or the other·tsx
// app/(marketing)/page.tsx
export const dynamic = 'force-static';

// app/(app)/page.tsx
export const dynamic = 'force-dynamic';

// Default: 'auto' — detected from your code.

External links

Exercise

Sketch (in writing) the rendering plan for a small SaaS: marketing site, product catalog with prices that change weekly, signed-in dashboard. For each, name the strategy and the specific Next.js feature that puts the route there.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.