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โ
Request arrives โ render now โ send useful shell early โ stream remaining regions later
Render before request โ wait for static result โ store/cache output โ serve reusable result later
PPR bridges static and dynamic workโ
Static API familiesโ
import { prerender } from 'react-dom/static';
For Node.js streams:
import { prerenderToNodeStream } from 'react-dom/static';
prerender โ Web ReadableStreamprerenderToNodeStream โ Node.js streamprerenderโ
import { prerender } from 'react-dom/static';
const { prelude, postponed } = await prerender(<App />, {
bootstrapScripts: ['/main.js'],
});
prelude contains the static HTML stream.
postponed is:
nullwhen 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.
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:
Product layout ยท description ยท public cached content ยท stable marketing copy
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โ
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.
Versioning postponed artifactsโ
A deployment can make old continuation state incompatible.
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โ
All render work starts at request time.
Useful shell can stream early.
Some rendering happened earlier.
Request resumes only unfinished/dynamic work.
PPR vs browser fetchingโ
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โ
Common mistakesโ
- calling
prerenderexpecting user-facing progressive streaming before prerender completion; - inspecting or mutating postponed state;
- resuming old continuation state after an incompatible deployment;
- using
renderToStaticMarkupfor 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:
- fully static catalog page;
- request-time streaming SSR page;
- 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โ
Referencesโ
- https://react.dev/reference/react-dom/static
- https://react.dev/reference/react-dom/static/prerender
- https://react.dev/reference/react-dom/static/prerenderToNodeStream
- https://react.dev/reference/react-dom/server/resume
- https://react.dev/reference/react-dom/server/resumeToPipeableStream
- https://react.dev/blog/2025/10/01/react-19-2