# Streaming SSR

> The Streaming SSR is a technique of sending server-rendered HTML to the browser in chunks as soon as they are ready.

## What is streaming SSR and how does it work?

The technique where the server sends HTML in parts instead of waiting for the whole page. Fast parts are shown immediately and slower parts with data stream in later, which improves TTFB and FCP.

- Topic: Web Application
- Type: technique

## Example

Wrong:

```jsx
export default async function Page() {
  const reviews = await getReviews();
  return <Reviews data={reviews} />;
}
```

Right:

```jsx
export default function Page() {
  return (
    <Suspense fallback={<ReviewsSkeleton />}>
      <Reviews />
    </Suspense>
  );
}
```

The slow fetch moves into `Reviews` inside a `Suspense` boundary, so the server sends the shell first and streams reviews when ready.

## Common mistakes

- Trying to redirect or set a cookie after streaming has already started.

## Key points

- Slow data is wrapped in `Suspense` boundaries with fallbacks, so the shell is sent first.
- Status code and headers are decided before the first chunk, since they cannot change later.
- Proxies and compression do not buffer the whole response before sending it.

## Interview questions

### Does streaming SSR hurt SEO?

No. Crawlers receive the full HTML once the stream ends, and the faster first byte can improve load metrics.

### Why does my response not stream?

A proxy, CDN or compression layer is buffering the whole response. Turn buffering off, for example with the 'X-Accel-Buffering: no' header in Nginx.

### Streaming SSR vs regular SSR: what is the difference?

Regular SSR waits for all data before sending any HTML, while streaming sends the shell at once and fills in slow parts later.

## Related cards

- [SSR](https://wonderium.dev/web/ssr.md)
- [`<Suspense>`](https://wonderium.dev/react/suspense.md)
- [renderToPipeableStream()](https://wonderium.dev/react/render-to-pipeable-stream.md)
- [Hydration](https://wonderium.dev/web/hydration.md)
- [TTFB](https://wonderium.dev/web/ttfb.md)

---

- Level: [Web Platform](https://wonderium.dev/web.md)
- HTML version: https://wonderium.dev/web/streaming-ssr
- Last updated: 2026-11-25
