next.js
2afe8f04 - [Segment Cache] set fetchStrategy on segments from a dynamic request (#82059)

Commit
157 days ago
[Segment Cache] set fetchStrategy on segments from a dynamic request (#82059) For non-PPR routes and full prefetches, we fetch multiple segments with one dynamic request. Then, we deconstruct the response into segments and create segment cache entries for them. However, when doing this, we weren't correctly setting the fetch strategy for these cache entries, leaving it at the default (`PPR`). The most correct way to model this is to simulate the flow that a normal segment prefetch would go through -- we create an empty segment, upgrade it to a pending one (which requires setting `fetchStrategy`) and finally fulfill it. I've adjusted `fulfillSegmentCacheEntry` to only accept pending segments so that it's not possible to have a fulfilled segment whose fetch strategy wasn't set, like we were doing before.
Author
Parents
Loading