Partial prerendering

Intermediate · 24 min

Partial prerendering serves a prebuilt static shell and streams dynamic holes into it. In Next.js 16 it is the default with Cache Components.

Before thisStatic and dynamic renderingCache Components and use cacheLoading UI and streaming

Clerk · 24 min

Partial prerendering

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by ClerkReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • Partial prerendering builds one static shell per route from everything that can finish at build time, and leaves Suspense fallbacks where request-time content will stream in.
  • In Next.js 16 it is the default behavior of cacheComponents; the old experimental.ppr flag and experimental_ppr route config are gone.
  • The shell can be served from a CDN, so even pages with dynamic parts show meaningful HTML immediately.
  • Move await params, cookies(), and searchParams as deep as possible, inside Suspense, so more of the page lands in the shell.
  • Short-lived caches, the seconds profile, or an expire under five minutes, are not prerendered and become dynamic holes.

The false choice

For years a route had to pick. Static meant fast but could not hold anything personal. Dynamic meant personal but slow, because the visitor waited for the whole page to render. A product page with a user’s cart badge forced you to pick one. People picked dynamic and accepted the delay for everyone.

That choice was never necessary. Most of the page is the same for everyone. Only the small personal part is not.

One shell, holes for the personal parts

Partial prerendering splits a route along that line. At build time Next.js renders the tree as far as it can. Work that completes is baked in. Where it reaches something that needs a request, it stops and records the nearest <Suspense> fallback. The result is a static shell: HTML for first loads and an RSC payload for client navigations.

At request time the shell is returned at once, from a CDN if you have one, and the dynamic holes stream in. The visitor sees the page layout, product details, and a skeleton where the cart badge will appear, and then the badge arrives.

The docs show this on a blog page: the header is static, the posts are cached with use cache and cacheLife('hours'), and a <UserPreferences> component reading cookies() sits in a <Suspense> with a fallback. The header and the posts are in the shell, the fallback is in the shell, and the preference text streams.

It is the default, not a feature flag

Partial prerendering was an experiment in Next.js 14 and 15 behind experimental.ppr. In 16 it arrives as the default behavior of cacheComponents. The docs state that the flag and the experimental_ppr segment config are no longer necessary and have been removed. If you read an older tutorial telling you to add export const experimental_ppr = true, that is the historical version.

// next.config.ts
const nextConfig = { cacheComponents: true, partialPrefetching: true }

My 16.4.6 test project built this page as ◐ (Partial Prerender) prerendered as static HTML with dynamic server-streamed content, with no per-page opt-in.

Get more into the shell

How much lands in the shell depends on where you put your await. The docs’ example is a layout that does const { slug } = await params at the top. A dynamic params is request data, so the whole layout is request-bound. Pass the promise down instead:

export default function Layout({ children, params }: LayoutProps<'/shop/[slug]'>) {
  return (
    <div>
      <Sidebar />
      <Suspense fallback={<h1>Loading…</h1>}>
        {params.then(({ slug }) => <SlugHeading slug={slug} />)}
      </Suspense>
      {children}
    </div>
  )
}

Now <Sidebar />, children, and the fallback are in the shell; only the heading streams. The same applies to cookies(), headers(), searchParams, and fetches. The rule: push the access to the leaf.

Cache lifetime matters too. A use cache entry is part of the shell only if its life is long enough: the docs say revalidate: 0, an expire under 5 minutes, or a stale under 30 seconds exclude it from prerenders, and the seconds preset falls under that. Those become request-time holes. Use a <Suspense> boundary around them.

Where the shell is validated

Next.js checks this for you. If a route cannot produce a static shell, because something needs the request and has no boundary, the dev overlay and build both report it. Newer 16.x releases also validate client navigations, not just direct visits, which the docs call instant navigation. That checking is why partial prerendering stays reliable instead of silently degrading to dynamic.

Partial prefetching

partialPrefetching is a companion option. With it, <Link> prefetches each route’s App Shell by default instead of the whole page. For per-URL content like searchParams, you can set prefetch={true} on that link, at the cost of a server invocation per prefetchable link. Linking and navigating covers the Link side.

What the video covers

Clerk’s video, with Hamed Bahram, was published in December 2025. By its chapters: partial pre-rendering is stable, how Next.js detects dynamic versus static, Suspense versus use cache directives, building an e-commerce demo, implementing cache life and static params, dynamic rendering with Suspense, moving params inside Suspense boundaries, and a final build with mixed rendering. The e-commerce build runs long, so expect to skim some of it. Delba’s January 2024 video is the conceptual runner-up: it explains why PPR exists; its flags are out of date, but the model is still current.

Where this fits

Partial prerendering describes a single request’s anatomy. For pages with many URLs, you also decide which are built ahead. Next: generating static params.

Check yourself

  1. 01What is in a partial prerender's static shell?

    HTML and an RSC payload built from everything that completes at build time, including cached results, plus the Suspense fallbacks for components that need request-time or uncached data.

  2. 02How do you turn partial prerendering on in Next.js 16?

    Set cacheComponents to true in next.config.ts, which makes it the default behavior, since experimental.ppr and the experimental_ppr route config were removed.

  3. 03Why does awaiting params at the top of a layout hurt the static shell?

    A dynamic param is request data, so the await makes that layout request-bound, while passing the promise down and awaiting inside a Suspense boundary keeps the rest of the layout in the shell.

  4. 04How does a seconds cacheLife affect prerendering?

    Its expire of one minute is under five minutes, so the entry is excluded from prerenders and resolves at request time as a dynamic hole.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark