DEV Community

Cover image for Stop Making Users Wait: Streaming SSR Explained with a Real-World Example
Abdullah al Mubin
Abdullah al Mubin

Posted on

Stop Making Users Wait: Streaming SSR Explained with a Real-World Example

Have you ever clicked a page and just… stared at a blank screen?

For 2–3 seconds… nothing happens.

That’s the old way of Server-Side Rendering (SSR).

The server waits for everything… before sending anything.

But modern apps don’t work like that anymore.

They stream the page in parts.

Let’s break this down using a real-world example you already know:

An e-commerce product page (like Amazon).


Table of Contents


The Problem: The All-or-Nothing Bottleneck

Traditional SSR works like this:

  • The server gathers ALL data
  • Builds the FULL HTML
  • Sends it to the browser

Real-Life Analogy

Imagine a restaurant:

You order:

  • Drinks
  • Appetizer
  • Main course

But the restaurant says:

“We’ll serve everything only when the steak is ready.”


What Happens?

  • You sit there doing nothing
  • Table is empty
  • You get frustrated

Same Problem in SSR

If your page has:

Fast data

  • Product title
  • Images
  • Basic info

Slow data

  • Reviews
  • Recommendations
  • Personalized content

The fast data is blocked by slow data


Result

  • Blank screen
  • Slow Time To First Byte (TTFB)
  • Poor user experience

Real-World Scenario: Product Page Loading

Let’s say a user opens a product page.

Example:

Headphones product


The Problem

The page needs:

  • Navbar (fast)
  • Product info (medium)
  • Reviews (slow API)

Traditional SSR waits for ALL of this


The Solution: Streaming SSR & Suspense

Streaming SSR changes everything.

  • Instead of waiting for everything…
  • The server sends HTML in chunks

How the Page Loads in Chunks

Here’s what actually happens:


Chunk 1: Layout (Instant)

  • Navbar
  • Search bar
  • Page structure

Sent immediately

User feels: “Page is fast”


Chunk 2: Product Info

  • Product image
  • Price
  • Title

Loads next

User can already start browsing


Chunk 3: Heavy Data

  • Reviews
  • Recommendations

Loads later

Page keeps growing smoothly


Result

  • No blank screen
  • No waiting
  • Progressive loading

Feels instant


Code Example (Next.js + Suspense)

Here’s how you implement this:

import { Suspense } from 'react';

export default function ProductPage({ params }) {
  return (
    <div className="layout">

      {/* Loads instantly */}
      <Navbar />

      <main>

        {/* Product section */}
        <Suspense fallback={<ProductSkeleton />}>
          <ProductHero id={params.id} />
        </Suspense>

        {/* Slow section */}
        <Suspense fallback={<ReviewSkeleton />}>
          <Reviews id={params.id} />
        </Suspense>

      </main>
    </div>
  );
}
Enter fullscreen mode Exit fullscreen mode


`


What’s Happening Here?

  • Each <Suspense> creates a boundary
  • React sends content as it becomes ready
  • Fallback UI prevents layout shift

  • You define what can load later
  • React handles how to stream it

What “Streaming” Actually Means

Streaming doesn’t mean:

Breaking HTML randomly into chunks


It means:

Sending logical UI pieces as they’re ready


Under the Hood

  • Server keeps HTTP connection open
  • React renders components progressively
  • Sends HTML + small scripts
  • Browser injects content in the right place

It’s like progressive page assembly


Why This Is a Game Changer

Faster First Paint

Users see something instantly


Better Perceived Performance

Even if backend is slow:

UI feels fast


Better SEO

Search engines see content earlier


Selective Hydration

  • Header becomes interactive first
  • Slow parts hydrate later

Reduced TTFB Impact

No more waiting for full page render


Mental Model

If you remember just this:

  • Old SSR = Wait → Send everything
  • Streaming SSR = Send → Continue sending

“Render now, stream the rest”


Final Thoughts

Streaming SSR is not just a performance trick.

It’s a UX improvement.

Instead of:

  • Blank screens
  • Waiting

You give users:

  • Instant feedback
  • Progressive content

The best websites don’t make users wait.
They show something immediately—and improve it over time.


What About You?

Are you using Streaming SSR yet?

Or still relying on traditional SSR?

Let’s discuss in comment...


Top comments (0)