Course contentsShow
← React
Lesson 1663 of 2,39640. Server-Side RenderingFree lesson

What Streaming SSR Is: Sending HTML Incrementally

Learn how streaming SSR sends partial HTML to the browser before the full page is ready, improving perceived performance.

What Streaming SSR Is: Sending HTML Incrementally

You'll learn how streaming SSR delivers HTML to the browser in chunks, rather than waiting for the entire page to finish rendering on the server.

The Core Idea

Traditional SSR with renderToString works like this: React renders your entire component tree on the server, converts it all to HTML, and only then sends the complete result to the browser. If any part takes time (like a slow database query), the user sees nothing until everything is ready.

Streaming SSR changes the game. With renderToPipeableStream, React sends HTML to the browser as soon as parts are ready, even while other parts are still being generated on the server. It's like a restaurant serving your appetizer immediately while your main course is still cooking, rather than making you wait for the entire meal.

How It Works

When you use streaming SSR with Suspense boundaries:

  1. React quickly renders the shell of your page (layout, navigation, etc.)
  2. This initial HTML is sent to the browser immediately
  3. For components wrapped in <Suspense>, React sends the fallback first
  4. As async components finish rendering, React streams their HTML down
  5. Small inline scripts tell the browser where to insert each new chunk

The user sees something almost instantly—the page shell and loading states—then watches content progressively appear as it becomes ready. This dramatically improves perceived performance, especially on slow connections.

The Analogy

Think of downloading a video: streaming lets you start watching while it downloads, rather than waiting for the entire file. Streaming SSR applies the same principle to HTML generation.

Key Takeaway: Streaming SSR sends HTML incrementally as components become ready, delivering a faster first paint and better perceived performance than waiting for the complete page.