Here is the shape of almost every "Next.js is slow" complaint I get asked to look at:
// page.tsx
export default async function Page() {
const stats = await getStats(); // 1.5s query
const feed = await getFeed(); // 50ms query
return <Dashboard stats={stats} feed={feed} />;
// one slow query holds the entire page hostage
}Five sections. Four render in milliseconds. One runs a heavy query, and because the whole page waits for its slowest part, users stare at nothing for 1.5 seconds. The fix has shipped in React for years and most codebases still do not use it.
Step 1: Find the slow section
Every slow page has one culprit: a dashboard widget, a recommendations block, an unpaged comment count. Before touching Suspense, name it:
const t0 = performance.now();
const stats = await getStats();
console.log("stats", performance.now() - t0); // 1500msNo caching layer to configure yet. The point is that the rest of the page does not deserve to wait for this one query, and you cannot scope a boundary to a section you have not identified.
Step 2: Move the fetch into an async component
Give the slow query its own async server component. The parent stops awaiting it:
// stats-panel.tsx
export default async function StatsPanel() {
const stats = await getStats(); // slow fetch lives here now
return <Chart data={stats} />;
}
// page.tsx
export default async function Page() {
return (
<>
<StatsPanel />
<Feed /> {/* ships immediately, no longer waits */}
</>
);
}One catch: without a boundary, nothing improves yet. The parent still renders the child inside its own render, so the 1.5 seconds are still on the critical path. The move only pays off in the next step.
Step 3: Wrap it in a Suspense boundary
Now the parent renders instantly, ships its HTML, and the slow component streams into its slot:
import { Suspense } from "react";
export default function Page() {
return (
<>
<Suspense fallback={<StatsSkeleton />}>
<StatsPanel />
</Suspense>
<Feed />
</>
);
}The user sees the header, the feed, the layout immediately instead of a spinner for the whole route. StatsPanel arrives when the query resolves, streamed from the same server response.
Step 4: Design the skeleton for the layout
A fallback that collapses to 40 pixels when the real section needs 400 makes the page jump on arrival, and users read layout shift as broken:
// wrong: collapses, everything shifts up
<Suspense fallback={<div />}>
<Comments />
</Suspense>
// right: reserves the real footprint
<Suspense fallback={<CommentsSkeleton rows={5} />}>
<Comments />
</Suspense>The skeleton should reserve the section's real height and roughly mirror its layout. This is a design task, not a developer afterthought, and it is the difference between streaming that feels instant and streaming that feels glitchy.
Step 5: Keep it server-side
This pattern is server-side end to end. The client-side version of the same page is the thing streaming replaces:
// wrong: client fetching waterfall
useEffect(() => {
getStats().then(setStats); // loading state, extra JS,
}, []); // request waterfall, more code
// right: async server component + Suspense
<Suspense fallback={<StatsSkeleton />}>
<StatsPanel />
</Suspense>No client fetching library, no loading state per component, no waterfall of effects. The HTML streams; JavaScript that never needed to exist never ships.
A boundary per slow section, not per route. loading.js wraps the whole segment, which still makes your header wait for the slowest widget. If your page feels slow and you cannot name the section responsible, profile it first. Then give that one section a boundary instead of making every user wait for it.
Shipping a Next.js app that feels slow? The Suspense pass above is usually a day of work. Tell me about the page and I will tell you which sections get boundaries first.