Streaming Server Rendering with Suspense
Wrapping slow subtrees in Suspense (or adding a loading.tsx, which wraps the whole segment) lets Next.js flush the shell immediately and stream each subtree's HTML and RSC payload in when its data resolves, so one slow query no longer blocks first paint. Fallbacks render instantly and are replaced in place as chunks arrive over the same response.
This Concept is waiting for its first lesson!
Wrapping slow subtrees in Suspense (or adding a loading.tsx, which wraps the whole segment) lets Next.js flush the shell immediately and stream each subtree's HTML and RSC payload in when its data resolves, so one slow query no longer blocks first paint. Fallbacks render instantly and are replaced in place as chunks arrive over the same response.
Are you a teacher? Sign in to start contributing.
Sign In