next.js
798d0d6a - Distinguish fully static prerenders from complete runtime prefetches

Commit
60 days ago
Distinguish fully static prerenders from complete runtime prefetches The server prepends a completeness marker byte to RSC Flight responses. Previously, both fully static prerenders and complete runtime prefetches used `#` (0x23), which caused the client to incorrectly set `route.isFullyStatic` for non-fully-static pages whose runtime render happened to complete without aborting. This made the segment cache skip the dynamic follow-up request at navigation time, leaving content from non-runtime-prefetchable segments missing. Introduce a third marker byte `*` (0x2a) for complete runtime prefetches from `finalRuntimeServerPrerender`, reserving `#` for build-time prerendered fully static pages. The client now only sets `route.isFullyStatic` when it sees `#`, which is only served for pages that are genuinely fully static. The three markers are defined in a shared `ResponseCompletenessMarker` enum: - `#` (Static) — fully static prerender, all segments present - `*` (Complete) — complete runtime prefetch, included segments are complete but the response may omit segments - `~` (Partial) — partial, contains dynamic holes
Author
Committer
Parents
Loading