Streaming with Suspense
A page that fetches data blocks its whole render until every request resolves. Streaming breaks the page into chunks and sends each one as soon as it is ready, so the user sees the shell immediately instead of a blank screen.
Wrap a slow component in <Suspense> with a fallback. Everything outside the
boundary renders and streams at once; the content inside streams in when its
data settles:
export default function BlogPage() {
return (
<div>
<header>
<h1>Welcome to the Blog</h1>
</header>
<Suspense fallback={<BlogListSkeleton />}>
<BlogList />
</Suspense>
</div>
);
}
The part of the page that does not depend on uncached data — here the header — is the static shell. Next.js can prerender it ahead of time and serve it instantly, then fill in the streamed holes. That combination is Partial Prerendering: a fast, static shell plus progressively streamed dynamic content.
A loading.tsx file does the same thing for a whole route segment — Next.js
automatically nests it in a <Suspense> boundary around the page. But a layout
that reads uncached data does not fall back to a same-segment loading.tsx, so
placing <Suspense> closer to the uncached access is the recommended, more
granular choice.
You are about to answer a short quiz on <Suspense> and the static shell.