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({
const routerInstance: AppRouterInstance = {
back: () => window.history.back(),
forward: () => window.history.forward(),
prefetch:
process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE
prefetch: process.env.__NEXT_CLIENT_SEGMENT_CACHE
? // Unlike the old implementation, the Segment Cache doesn't store its
// data in the router reducer state; it writes into a global mutable
// cache. So we don't need to dispatch an action.
......
......@@ -173,7 +173,7 @@ export function navigateReducer(
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
//
// Bypass the normal prefetch cache and use the new per-segment cache
......
......@@ -11,8 +11,7 @@ import {
export const prefetchQueue = new PromiseQueue(5)
export const prefetchReducer =
process.env.__NEXT_PPR && process.env.__NEXT_CLIENT_SEGMENT_CACHE
export const prefetchReducer = process.env.__NEXT_CLIENT_SEGMENT_CACHE
? identityReducerWhenSegmentCacheIsEnabled
: 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