next.js
457083c8 - Cached Navigations: Cache fully static initial HTML RSC payload

Commit
2 days ago
Cached Navigations: Cache fully static initial HTML RSC payload When a fully static page is loaded, the RSC payload inlined in the HTML is now written into the client-side segment cache during hydration. This allows subsequent client-side navigations to the same route to be served entirely from cache without any server requests, until the stale time expires. Server: Include a `StaleTimeIterable` (`s` field) in the `InitialRSCPayload` during the Cache Components prerender path. The iterable is tracked on `finalServerPrerenderStore` and closed alongside the vary params accumulator in the sequential task after prerender completes. Client: Thread the stale time and head vary params from the decoded payload through `createInitialRouterState` into a new `writeInitialSeedDataIntoCache` function that writes each segment and the head into the segment cache using the existing `writeSeedDataIntoCache` / `fulfillEntrySpawnedByRuntimePrefetch` functions. Partially static pages (resumed at runtime) are not handled yet. Those need byte-level truncation of the Flight stream to extract only the static stage (same as for dynamic RSC requests).
Author
Committer
Parents
Loading