-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow prefetches to skip already cached segments
During a non-PPR prefetch, where we render up to the nearest loading boundary, we should be able to skip segments that are already cached on the client. To do this, we need to be able to tell the server that a segment is already cached while also indicating where the "new" part of the navigation starts — that is, the part inside the shared layout. To do this, I added a new kind of marker to FlightRouterState called "inside-shared-layout". It's similar to the "refresh" marker but has different semantics. I tried my best to explain how it's used in the code comments. This implements the marker but does not yet change any behavior on the client. I'm submitting this as its own PR to confirm that none of the existing behavior regresses. I'll follow up with the client changes in a separate PR. As another follow-up, we're overdue for a redesign of the protocol for sending dynamic requests. I'm not sure it makes sense to use the FlightRouterState type, given that it's overloaded with so many other concerns.
- Loading branch information
Showing
2 changed files
with
115 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters