Under The Hood
frontend nextjs Next.js 14+ / 15

Partial Prerendering (PPR): Static Shell & Dynamic Streaming

Last updated
Prerequisites:
React Suspense
Next.js App Router static vs dynamic rendering
  • nextjs
  • ppr
  • streaming
  • suspense
  • performance
  • app-router

Read at your depth

The practical view

Partial Prerendering (PPR) lets a single route combine static prerendering and dynamic streaming. Everything outside a `<Suspense>` boundary is built statically at compile time and cached on the CDN edge. Components wrapped in `<Suspense>` containing dynamic calls (like `cookies()`, `headers()`, or uncached `fetch()`) stream in parallel as HTML chunks after the initial shell arrives. Enable it in `next.config.js` via `experimental.ppr = true`.

The same idea in other frameworks

react equivalent
Combines `prerender` / `renderToPipeableStream` with fallback markers.

Legacy vs modern

All-or-nothing SSR vs Partial Prerendering

Traditional dynamic SSR forces the entire route to wait on the server; PPR delivers a static layout immediately while streaming dynamic segments.

before → after
Full Dynamic SSR
export const dynamic = 'force-dynamic'; // ❌ OLD: Entire page blocks on dynamic calls
PPR with Suspense
export const experimental_ppr = true; // ✅ NEW: Instant shell + streamed dynamic hole

Interview gotchas

Context

Interviewers test whether you understand how Next.js determines boundary constraints during build-time compilation.

The mechanical answer

If a dynamic function like `cookies()`, `headers()`, or `searchParams` is invoked outside a `<Suspense>` boundary in a PPR-enabled route, the build process cannot isolate the dynamic execution. Consequently, the entire route bails out of static generation and falls back to full dynamic server rendering on every request.

Trap

Do not claim that Next.js automatically wraps un-suspended components in Suspense. Uncaught dynamic reads in the outer tree invalidate the static shell completely.

Under The Hood — a multi-depth technical interview hub.

Third-party licenses Press ⌘ K to search.