Unverified Commit e7b58935 authored by Andrew Clark's avatar Andrew Clark Committed by GitHub

Remove PPR feature check from Segment Cache client (#74669)

Follow-up to #73960. We should no longer check if PPR is enabled when
determining whether to use the Segment Cache or the old client cache.
parent 1f4fa25f
...@@ -275,8 +275,7 @@ function Router({ ...@@ -275,8 +275,7 @@ function Router({
const routerInstance: AppRouterInstance = { const routerInstance: AppRouterInstance = {
back: () => window.history.back(), back: () => window.history.back(),
forward: () => window.history.forward(), forward: () => window.history.forward(),
prefetch: prefetch: process.env.__NEXT_CLIENT_SEGMENT_CACHE
process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE
? // Unlike the old implementation, the Segment Cache doesn't store its ? // Unlike the old implementation, the Segment Cache doesn't store its
// data in the router reducer state; it writes into a global mutable // data in the router reducer state; it writes into a global mutable
// cache. So we don't need to dispatch an action. // cache. So we don't need to dispatch an action.
......
...@@ -173,7 +173,7 @@ export function navigateReducer( ...@@ -173,7 +173,7 @@ export function navigateReducer(
return handleExternalUrl(state, mutable, href, pendingPush) return handleExternalUrl(state, mutable, href, pendingPush)
} }
if (process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE) { if (process.env.__NEXT_CLIENT_SEGMENT_CACHE) {
// (Very Early Experimental Feature) Segment Cache // (Very Early Experimental Feature) Segment Cache
// //
// Bypass the normal prefetch cache and use the new per-segment cache // Bypass the normal prefetch cache and use the new per-segment cache
......
...@@ -11,8 +11,7 @@ import { ...@@ -11,8 +11,7 @@ import {
export const prefetchQueue = new PromiseQueue(5) export const prefetchQueue = new PromiseQueue(5)
export const prefetchReducer = export const prefetchReducer = process.env.__NEXT_CLIENT_SEGMENT_CACHE
process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE
? identityReducerWhenSegmentCacheIsEnabled ? identityReducerWhenSegmentCacheIsEnabled
: prefetchReducerImpl : prefetchReducerImpl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment