You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently working through some issues surfaced by the new
per-segment routes introduced by the Segment Cache experiment. Testing
of this feature in production has been blocked while we figure that out.
However, aside from per-segment prefetching, there are a bunch of
client-only changes and improvements to the Segment Cache implementation
that we can test in the meantime.
So, I've added a "client-only" option the `clientSegmentCache` flag.
When enabled, Next.js will not generate per-segment prefetch responses,
but the client will switch to the new prefetching implementation. This
includes:
- De-duping of shared layouts across prefetch requests.
- More resilience to race conditions.
- Prefetch cancellation on Link viewport exit.
- Re-prefetching stale data after revalidateTag/revalidatePath.
etc.
It's essentially a complete rewrite of the client-side prefetching
implementation. Given the scope of the change, it may contain subtle
regressions that I haven't yet discovered. That's why it's so urgent for
me to start testing this in real apps.
I initially hesitated to implement the "client-only" option because 1)
there are already so many combinations of flags and forked
implementations to juggle, and I didn't want to add another one, and 2)
I thought it would take less time to fix the deployment issues that are
blocking the wider rollout.
But it turned out to be less net new complexity than I anticipated,
given that I already had to support `ppr: "incremental"`, which works in
a largely similar way.
0 commit comments