Unverified Commit b16e1013 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

[segment cache]: collectSegmentData should respect experimental.staleTime config (#84520)

When we calculate the desired `staleTime` value we leverage the
`selectStaleTime` util which has some logic to fallback to the
`experimental.staleTimes` configuration if not otherwise overridden in
the prerenderStore. Without this change, the static staleTime from the
`/_tree` requests would always be the max (1 year), regardless of user
configuration.

This was caught by `prefetching.stale-times.test.ts` which I have
re-enabled & refactored in the next PR in the stack.
parent cc01bcd6
...@@ -4833,7 +4833,8 @@ async function collectSegmentData( ...@@ -4833,7 +4833,8 @@ async function collectSegmentData(
serverModuleMap: getServerModuleMap(), serverModuleMap: getServerModuleMap(),
} }
const staleTime = prerenderStore.stale const selectStaleTime = createSelectStaleTime(renderOpts.experimental)
const staleTime = selectStaleTime(prerenderStore.stale)
return await ComponentMod.collectSegmentData( return await ComponentMod.collectSegmentData(
renderOpts.experimental.clientParamParsing, renderOpts.experimental.clientParamParsing,
fullPageDataBuffer, fullPageDataBuffer,
......
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