Skip to main content

Static rendering, resume APIs, and partial pre-rendering

Streaming SSR optimizes request-time progressive delivery.

Static rendering optimizes a different problem: do reusable rendering work ahead of the request.

React 19.2 also provides a bridge between those models: partial pre-rendering (PPR), where completed static work is stored and unfinished work can be resumed later.

Rendering strategy mental modelโ€‹

Static rendering and streaming SSR start at different times
REQUEST TIMEStreaming SSR

Request arrives โ†’ render now โ†’ send useful shell early โ†’ stream remaining regions later

AHEAD OF TIMEStatic rendering

Render before request โ†’ wait for static result โ†’ store/cache output โ†’ serve reusable result later

PPR bridges static and dynamic workโ€‹

Partial pre-rendering reuses completed work and resumes unfinished regions later
1Prerender ahead of time
2Abort/postpone unfinished regions
3Store prelude + opaque postponed state
4Request arrives
5Resume unfinished work
6Stream dynamic remainder

Static API familiesโ€‹

import { prerender } from 'react-dom/static';

For Node.js streams:

import { prerenderToNodeStream } from 'react-dom/static';
Match the static API to the runtime
Web Streams
prerender โ†’ Web ReadableStream
Node Streams
prerenderToNodeStream โ†’ Node.js stream

prerenderโ€‹

import { prerender } from 'react-dom/static';

const { prelude, postponed } = await prerender(<App />, {
bootstrapScripts: ['/main.js'],
});

prelude contains the static HTML stream.

postponed is:

  • null when prerendering completed fully;
  • an opaque serializable continuation state when unfinished work was postponed.

Static rendering waits for Suspense dataโ€‹

function ProductPage() {
return (
<>
<Header />
<Suspense fallback={<ReviewsSkeleton />}>
<Reviews />
</Suspense>
</>
);
}

For a Suspense-enabled data source, prerender normally waits for the suspended content before resolving the completed static result.

prerender is not progressive browser streaming
Start static render
Suspense-enabled data resolves
Receive prelude for storage/serving

If the product goal is to show a user a shell while request-time work is still loading, use streaming SSR instead.

Aborting creates a PPR continuation boundaryโ€‹

const controller = new AbortController();

setTimeout(() => {
controller.abort();
}, 5000);

const { prelude, postponed } = await prerender(<App />, {
signal: controller.signal,
});

When a prerender stops before every Suspense region completes, React can preserve the finished output and return postponed continuation state for unfinished work.

What PPR is buying youโ€‹

Imagine an ecommerce page:

Static and request-specific regions have different reuse rules
Reusable static work

Product layout ยท description ยท public cached content ยท stable marketing copy

Request-specific work

User cart ยท permissions ยท personalized inventory/message ยท recommendations ยท request-bound data

A pure static page may be too stale or unsafe. A pure request-time page may repeat work that could be reused. PPR lets the architecture preserve that distinction.

Postponed state is opaque React-owned continuation dataโ€‹

Do not inspect or mutate postponed state
Prerendered tree
Opaque postponed state
Serialize/store it as an artifact; do not depend on its internals.
Resume API receives the state

Your infrastructure owns storage/versioning. React owns the continuation representation.

Resume APIsโ€‹

Web Stream environments:

import { resume } from 'react-dom/server';

const stream = await resume(<App />, postponedState, options);

Node.js:

import { resumeToPipeableStream } from 'react-dom/server';

const { pipe, abort } = await resumeToPipeableStream(
<App />,
postponedState,
options
);

The goal is the same: skip completed prerendered work where React can, continue unfinished work, and stream the request-time remainder.

Prerender and resume are one contractโ€‹

Some configuration belongs to the original prerender so the resumed render remains consistent with the static output. For example, bootstrap resource configuration belongs to the prerender stage rather than being independently reinvented during resume.

Resume is not an unrelated second render
Prerender stage
Tree shape ยท build version ยท identifiers ยท bootstrap resources ยท completed static work
Resume stage
Must continue a compatible logical tree and rendering configuration

Versioning postponed artifactsโ€‹

A deployment can make old continuation state incompatible.

Treat postponed state like versioned build output
1Build A prerenders
2Store prelude + postponed A
3Deploy build B
4Invalidate incompatible A continuation
5Generate/resume with matching version

Do not blindly resume state from an incompatible tree, locale/configuration contract, or deployment version.

Experimental continuation APIsโ€‹

React also documents experimental static continuation APIs such as:

  • resumeAndPrerender;
  • resumeAndPrerenderToNodeStream.

They continue postponed work into further static output rather than switching immediately to request-time SSR streaming.

Because they are marked experimental, treat them as architecture awareness rather than a portability-critical stable contract.

PPR vs streaming SSRโ€‹

PPR can feed into streaming rather than compete with it
Streaming SSR

All render work starts at request time.
Useful shell can stream early.

PPR

Some rendering happened earlier.
Request resumes only unfinished/dynamic work.

Reuse static work + progressively deliver dynamic remainder

PPR vs browser fetchingโ€‹

Dynamic work can finish on the server or after hydration in the browser
Static HTML + client fetch
Serve static page โ†’ hydrate โ†’ browser requests dynamic data.
PPR resume
Serve/reuse static work โ†’ server resumes dynamic regions โ†’ stream server-rendered remainder.

PPR can reduce client orchestration, but it requires stronger server infrastructure, storage/versioning, and framework/runtime integration.

Legacy/non-interactive rendering APIsโ€‹

import { renderToString } from 'react-dom/server';
const html = renderToString(<App />);

renderToString is a compatibility path with limited Suspense/progressive behavior compared with modern APIs.

import { renderToStaticMarkup } from 'react-dom/server';
const html = renderToStaticMarkup(<Email />);

renderToStaticMarkup is for non-interactive HTML such as emails or generated documents. Do not use it for a page you intend to hydrate.

Static generation is also a cache/security decisionโ€‹

Static output is only reusable when every input that affects correctness is represented in the cache/invalidation contract.

Important dimensions can include:

  • authenticated user;
  • organization/tenant;
  • locale and currency;
  • permissions;
  • feature flags;
  • request headers/geography;
  • AB-test assignment;
  • content version and freshness.

Never publish personalized HTML as globally shared static output by accident.

Rendering strategy decisionโ€‹

Which rendering direction fits the output contract?
Interactive request-time HTML with progressive loadingStreaming SSR
Reusable Suspense-aware HTML generated ahead of timeprerender / prerenderToNodeStream
Reuse static work but finish dynamic work per requestPPR with postponed state + resume
Non-interactive HTML documentrenderToStaticMarkup

Common mistakesโ€‹

  • calling prerender expecting user-facing progressive streaming before prerender completion;
  • inspecting or mutating postponed state;
  • resuming old continuation state after an incompatible deployment;
  • using renderToStaticMarkup for an app that must hydrate;
  • publicly caching personalized output;
  • treating experimental continuation APIs as stable portability contracts.

Exerciseโ€‹

Design three versions of a product page:

  1. fully static catalog page;
  2. request-time streaming SSR page;
  3. PPR page with static product content and request-time cart/inventory.

For each, document what runs ahead of time, what runs per request, what can be cached, what must never be shared, and where hydration begins.

Interview questionsโ€‹

Junior: What is the difference between static rendering and streaming SSR?

Mid-level: Why does prerender normally wait for Suspense data instead of progressively revealing it to a current user?

Senior: How do postponed state, deployment versioning, cache keys, personalization, and resume APIs shape a safe production PPR architecture?

Summaryโ€‹

Static rendering and PPR in one lifecycle
1Prerender reusable work
2Store static prelude
3Preserve opaque postponed state when needed
4Resume on matching request/build
5Stream dynamic remainder

Referencesโ€‹