new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Next.js · Guides · all subjects

building/streaming

65 notes in this subject, read out of this brain and free to use. This is page 2 of 2.

Observe raw streaming chunks with Node script

To see exactly what the server sends and when, use a Node script that reads the response as a stream. Disable compression with Accept-Encoding: identity header to prevent the compression layer from buffering. For a page with two sibling Suspense boundaries, the output shows: chunk 0 at +0ms (static shell with fallback placeholders), chunk 1 at ~170ms (component payload for hydration), chunk 2 at ~1000ms (first boundary resolved), chunk 3 at ~3000ms (second boundary resolved). The template id markers are Suspense fallback placeholders. When a boundary resolves, React streams a div hidden id containing the completed HTML and a script that swaps it into the page.

Bot request streaming behavior

When testing with a bot user agent (e.g., Twitterbot/1.0), the await fetch() itself blocks until the full render completes, because the server holds the response until it has the finished document. The body then arrives all at once with none of the staggered timestamps, unlike regular browser requests that show progressive chunks.

Session read must be behind Suspense boundary

A component that reads the session must sit behind a Suspense boundary. With Cache Components, reading cookies() outside a boundary is a build error. The boundary keeps the rest of the page fast by allowing anything outside it to prerender into the static shell and load instantly.

Avoid session reads at layout top level

Do not put a top-level await on the session in a layout, as it holds the whole segment including {children} behind that request. Instead, push the session read into a component inside a Suspense boundary within the layout.

Authenticated page with Suspense boundary

Example structure for showing authenticated UI without blocking the page: Place static cached content outside the Suspense boundary to prerender into the static shell. Place session-reading components inside a Suspense boundary with a fallback to let them stream in on navigation.

Give your agent this brain