← All notes

Build a Next.js static shell with Cache Components and React prerender()

Answer: With Cache Components enabled, Next.js prerenders a static shell. A fallback ships with the prerendered shell while the async work runs at request time. React prerender() can be used for partial prerendering: Suspense boundaries with incomplete children are included in the prelude in the fallback state.

The Next.js static shell

Enable Cache Components by setting cacheComponents: true in next.config.ts. Route Handlers follow the same prerendering model as pages. Cached results become part of the static shell. During prerendering, static content and cached dynamic content can be included in that shell, along with the fallback UI. UI stored in cookies streams in at request time. A fallback UI while async work completes does not itself opt a component into dynamic rendering. Synchronous-only work can still finish during prerendering.

React prerender()

prerender(reactNode, options?) returns a prelude (and postponed). You can force the prerender to give up after a timeout; the prelude will contain all the HTML that was prerendered. Incomplete Suspense children appear in the prelude in the fallback state. Nonces must be unique per request, so they are not an available option when prerendering.

Prefetching warning

The first release of Cache Components did not include Partial Prefetching. Leaving it unset logs a warning. Set it when migrating an app that adopted Cache Components before Partial Prefetching.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Next.js docs, Caching (Cache Components); React docs, prerender. MIT; CC-BY-4.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Next.js docs, Caching (Cache Components); React docs, prerender. MIT; CC-BY-4.0.

Cite this

Permanent ID: iil:note:200v5hsj

iinventedlight. 2026. "Build a Next.js static shell with Cache Components and React prerender()." iinventedlight Library, iil:note:200v5hsj, version of 2026-11-19. https://iinventedlight.com/library/notes/nextjs-partial-prerendering/. License: CC-BY-4.0.

@misc{iil_note_200v5hsj,
  author = {{iinventedlight}},
  title = {{Build a Next.js static shell with Cache Components and React prerender()}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-19},
  url = {https://iinventedlight.com/library/notes/nextjs-partial-prerendering/},
  note = {Permanent ID iil:note:200v5hsj. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/nextjs-partial-prerendering.md.