Partial Pre-rendering:
- What Partial Prerendering Is
- An experimental Next.js rendering mode that combines static and dynamic rendering in the same route.
- Prerenders the “shell” of your page (layout, headers, static content) at build time.
- Leaves “holes” for any components that depend on request-time data (cookies, headers,
fetch({ cache: 'no-store' })
, searchParams
, etc.).
- Streams dynamic pieces into the already-delivered HTML shell over a single HTTP response.
- Why It’s Smart
- Faster First Load: Users see the static shell immediately (boosting TTFB, FCP, LCP) while personalized content loads in.
- Perceived Performance: Reduces blank-screen time—page structure appears at once, with user-specific details filling in seamlessly.
- Best of Both Worlds: Blends Jamstack-style speed (SSG) with SSR’s flexibility without choosing one over the other.
- Simplified Dev Experience: Just enable
experimental_ppr
and wrap dynamic parts in React <Suspense>
—Next.js handles stream orchestration automatically.
- Bandwidth Efficiency: Only the dynamic fragments travel on each request; static assets can be cached globally.
- Experimental Status
- Currently gated behind
experimental.ppr
in next.config.js
.
- API and behavior may change as the Next.js team gathers feedback.
- Ideal for prototyping or low-risk routes; avoid critical production paths until it graduates from experimental.