Next.js cache components repro
Compare the stale prefetch lane against the fresh-on-click lane.
This demo now mirrors the original app shape more closely: the nav is wrapped in Suspense, both fallback and resolved nav states render the same destinations, and the two route families share the same cached list and mutation flow.
Repro signal: create an item, open it, add one comment, then use the top-nav Home link. The repro lane can briefly reuse a stale prefetched payload and show 0 comments until a hard reload. The control lane fetches on click and should show the updated count immediately.
What changed in this demo
- Two route families share the same item/comment store.
- The lane nav renders matching links in fallback and resolved states.
- The only intended behavior delta is Home link prefetch mode.
Repro lane
Default prefetch stays on
Use the lane that keeps Link prefetch enabled on the duplicated Home nav. This is the path that can reproduce the stale return navigation.
Open /with-prefetchControl lane
Home navigation fetches on click
Use the lane that sets prefetch={false} on the duplicated Home nav. It keeps the same data and mutations, but avoids the stale prefetched payload path.
Open /without-prefetch