Why is streaming responses useful?

Why is streaming responses useful?

I used to wonder why streaming with Suspense in React is useful.

Traditionally, you have to wait for the server to finish all its work before the browser gets the document.

Once the browser gets the document, it can start working, like downloading assets.

With streaming responses, you only need to wait for the server to do the necessary work before the browser gets the document. The server doesn't need to finish everything.

In the network tab, you'll see that with streaming, we shorten the time to get the initial document and can start the browser's work in parallel.

This improves both the actual and perceived performance of the site, making it feel faster for users.

To better demonstrate this, I decided to make an image:

With streaming, all the work together (server + browser) finishes faster.