Streaming request timeline
What you need to know
Streaming allows the server to begin a response before every part of the interface is ready. Think of a shell with stable navigation and placeholders, followed by content that becomes available later. This improves the opportunity to see useful UI sooner, but does not reduce every underlying operation time.
By the end, you can: distinguish shell and later content; specify a bounded test.
Illustrative timeline (not measured)
Request -> render heading and fallback -> send headers and shell -> resolve recommendations -> send later content -> browser reveals recommendationsExpected behavior (not framework-tested): The response can contain the shell and later content in one request. Transport chunks are not guaranteed to match component boundaries.
How it works
The server must commit response headers before sending the body. After commitment, a late application outcome cannot rewrite the original HTTP status. A proxy, browser or compression layer may buffer data; an early server write therefore does not guarantee an early paint. Distinguish the raw HTTP stream from browser rendering and hydration. Test cold direct loads and client-side navigation independently, without an external service or invented speed measurement.
Manual loopback observation (after approved production start)
curl --no-buffer --max-time 10 -i http://127.0.0.1:3000/discoverExpected behavior (not framework-tested): Inspect the actual status and body arrival. This command is a proposed test, not a recorded transcript; a browser is still needed to verify visible fallback and reveal.
Common mistake
Do not assert a 500 ms paint or one chunk per component. Measure timings with a monotonic clock in the client and document buffering. For status-sensitive missing resources, resolve the existence check before a boundary can commit a response.
Practice and verification
Write a test plan that records headers, a shell marker, final content and elapsed times. Include cancellation or timeout, a cold request, a warm request and browser observations. Treat absent early fallback as a diagnostic finding, not proof streaming is impossible.
Scope: App Router, proposed Next.js 16.x, Cache Components disabled for these labs. Snippets assume a reviewed TypeScript app and are static examples; framework behavior has not been executed. Exact supported patch and dependency set must be verified before running.