Streaming Suspense Boundaries: Where We Put Them Wrong for Two Years
We treated Suspense as a loading-state tool. It's actually a streaming contract with the browser, and putting boundaries in the wrong place costs you LCP, CLS, and sometimes the whole page.
For about two years we used <Suspense> the way everyone on Twitter was using it: wrap the slow thing, show a spinner, ship it. Then we started measuring, and the picture got uglier. Suspense boundaries aren't just a UI nicety — they're the places where Next.js decides to flush HTML to the browser, and misplaced ones were silently tanking our LCP and shoving CLS past 0.1 on half our product pages.
This is the mental model we wish we'd had on day one, with the specific placement rules we now enforce in review.
Suspense is a flush point, not a spinner
In the App Router, every <Suspense> boundary is a potential HTML flush. The server renders what it can synchronously, hits a boundary whose children are still awaiting data, emits the fallback inline, and then streams the real content later as an out-of-order chunk that React swaps in on the client.
That means three things that are easy to forget:
- Everything above the first boundary blocks the first byte of useful HTML. If your root layout awaits a slow call, nothing streams until it resolves.
- Every boundary costs a little. It adds a template placeholder, a streamed chunk, and a hydration swap. Dozens of tiny boundaries hurt more than they help.
- The fallback's height matters. If your fallback is 40px tall and the real content is 400px, you just shipped yourself a CLS bomb.
Once you internalise that Suspense is a streaming contract — "I promise the real content will arrive, here is a same-sized placeholder in the meantime" — the placement rules write themselves.
The four placements we see in code review
Here's a page we rewrote recently. Product detail, with reviews and a recommendations rail. The first version looked reasonable:
// app/products/[slug]/page.tsx — the version we shipped and regretted
export default async function ProductPage({ params }: Props) {
const { slug } = await params;
const product = await getProduct(slug); // ~180ms p50
const reviews = await getReviews(slug); // ~600ms p50
const recs = await getRecommendations(slug); // ~900ms p50
return (
<main>
<ProductHero product={product} />
<Reviews reviews={reviews} />
<Recommendations items={recs} />
</main>
);
}
Three sequential awaits in the same server component. TTFB sat around 1.7s and LCP crept past 2.8s on mid-tier Android. Nothing streamed, because nothing was wrapped.
The fix people reach for first:
// Attempt 2: one giant boundary
<Suspense fallback={<PageSkeleton />}>
<ProductHero product={product} />
<Reviews reviews={reviews} />
<Recommendations items={recs} />
</Suspense>
This is worse. You've moved the wait, not removed it, and now the user stares at a skeleton for the duration of the slowest dependency.
The version that actually ships well:
// app/products/[slug]/page.tsx — the version that stuck
export default async function ProductPage({ params }: Props) {
const { slug } = await params;
return (
<main>
<Suspense fallback={<HeroSkeleton />}>
<ProductHeroLoader slug={slug} />
</Suspense>
<Suspense fallback={<ReviewsSkeleton />}>
<ReviewsLoader slug={slug} />
</Suspense>
<Suspense fallback={<RecsSkeleton />}>
<RecommendationsLoader slug={slug} />
</Suspense>
</main>
);
}
async function ProductHeroLoader({ slug }: { slug: string }) {
const product = await getProduct(slug);
return <ProductHero product={product} />;
}
Three things changed:
- The
page.tsxitself does no awaiting, so the shell streams immediately. - Each slow dependency lives in its own async child, so they fetch in parallel.
- Each boundary has a skeleton sized to the real content.
LCP on the same page dropped into the 1.6–2.0s range on the same devices.
The rule we now use
Put a Suspense boundary around the smallest async unit that has a stable, same-sized fallback.
Not around "the slow bit". Not at the page root. Around the async component whose loading shape you can honestly draw.
When not to add a boundary
We over-corrected after the above win and started wrapping everything. That was also wrong.
Don't wrap your LCP element. If your hero image or H1 is the LCP candidate, a Suspense boundary around it means Chrome's LCP observer sees the fallback first, then the real element — and depending on layout, it may or may not count the real paint. We've seen cases where a wrapped hero reported a worse LCP than an unwrapped one, because the fallback itself was being measured and then replaced below the fold threshold.
If the hero depends on data, fetch that data in the parent (blocking TTFB a little) rather than streaming it. A 200ms slower first byte with a correct LCP element beats a fast first byte and a spinner where the hero should be.
Don't wrap tiny synchronous components. A Suspense boundary around a 20-line sync component adds streaming overhead for zero benefit.
Don't wrap below a loading.tsx. The route-level loading.tsx is already a Suspense boundary around the whole route segment. Nesting another boundary immediately inside it just means you're painting a skeleton inside a skeleton.
The CLS trap in fallback design
This is the gotcha that cost us the most time. A Suspense fallback must occupy the same box as the content it replaces, or you'll ship layout shift every single render.
The common mistakes:
- Fallback is
<div>Loading…</div>— one line tall, real content is a 600px grid. - Fallback uses
min-heightbut real content uses intrinsic sizing with an image that loads later. - Fallback has different padding or margin than the real wrapper.
Our rule is that a skeleton component and the real component share a wrapper:
function ReviewsFrame({ children }: { children: React.ReactNode }) {
return (
<section
aria-label="Customer reviews"
className="min-h-[480px] py-8"
>
{children}
</section>
);
}
export function ReviewsSkeleton() {
return (
<ReviewsFrame>
<div className="animate-pulse space-y-4" aria-hidden />
</ReviewsFrame>
);
}
Both the skeleton and the real <Reviews> render inside ReviewsFrame. The frame owns the dimensions. Layout shift drops to zero because the box exists before and after the swap.
Accessibility, while you're there
Fallbacks are not invisible to screen readers by default. If you flash role="status" on every skeleton, assistive tech gets spammed. We've settled on:
- Skeleton visuals wrapped in
aria-hidden="true". - A single
role="status"region at the route level, with polite announcements only for user-initiated transitions (searches, filters), not for initial page load.
Boundaries and server actions
React 19's server actions interact with Suspense in a way that surprised us. When an action triggers a revalidation, the affected server components re-render and re-stream through their existing boundaries. If you don't have a boundary around the piece that changes, the entire route segment re-streams, which means the user sees the route-level loading.tsx again after submitting a form.
The fix is to put a boundary around the specific subtree the action invalidates:
<Suspense fallback={<CommentListSkeleton />}>
<CommentList postId={postId} />
</Suspense>
<AddCommentForm postId={postId} />
After revalidatePath or revalidateTag, only CommentList re-suspends. The form, header, and surrounding chrome stay mounted. Without that boundary, the whole page flashes its route skeleton after every comment.
A checklist we actually use
Before a Next.js PR merges, we ask:
- Does
page.tsxitself await anything that isn't fast and critical? If yes, push it into a child. - Does every Suspense boundary have a fallback that matches the real content's bounding box?
- Is the LCP element above any Suspense boundary, not inside one?
- Are there boundaries around subtrees that server actions will revalidate?
- Did we remove any boundary that wraps purely synchronous children?
It's a boring list. It has saved us more Core Web Vitals regressions than any clever caching strategy.
Where we'd start
If you're inheriting an App Router codebase and want a quick win: open your three highest-traffic routes, delete every <Suspense> inside them, and re-add boundaries one at a time only around components that (a) do their own async work and (b) have a skeleton you can honestly size. You'll usually end up with fewer boundaries than you started with, better LCP, and a page that streams the way the framework was designed to stream.
If you want a second pair of eyes on a streaming or Core Web Vitals problem, our web development team does this kind of audit regularly — and most of the fixes end up looking a lot like the checklist above.
Want a team like ours?
72Technologies builds production software for the kind of teams who actually read this blog.
Start a projectKeep reading
React 19's useOptimistic Is a Trap If You Don't Model Failure First
useOptimistic feels like free UX magic until a server action fails in ways you didn't plan for. Here's the mental model we wish we'd had before shipping it to production.
The `use cache` Directive Looked Clean Until We Shipped It
Next.js's `use cache` directive promised a cleaner caching model than fetch options and tags. Six weeks into production, we found three failure modes that aren't in the docs — and one that cost us a weekend.
Partial Prerendering in Production: What Broke, What Held
We shipped Next.js Partial Prerendering to a high-traffic marketing-plus-dashboard app. Here's what actually worked, what silently regressed, and the debugging patterns we wish we'd had on day one.
