d371f648d2
### What When a prefetch cache entry becomes "stale", it'll remain stale until eventually it gets evicted. However during that stale window, the cache is never revalidated, and so instant navigations stop working and data is fetched from origin every navigation. ### Why The `lastUsedTime` entry on the prefetch cache is currently only updated after the first read. Once it becomes stale, `applyFlightData`'s recursive functions will see that there is no longer a reusable prefetch cache entry, and will trigger a lazy fetch of the new data on every subsequent navigation. ### How This updates prefetch cache handling to always ensure we’re using a fresh or reusable prefetch cache entry. This means that stale prefetch entries will be refreshed on a navigation event. As a result of this, I’ve had to disable one of our tests that relies on this stale cache behavior. It’s not ideal that we’re blocked on the loading boundary when fetching child segment data—ideally we can refactor this to cache the loading component in the CacheNode and copy it over on navigations, similar to how ‘head’ is handled. I’ll work on this in a separate PR. Note: The new client cache test for this is disabled in PPR for the same reason as the other tests: auto prefetching with PPR navigations is currently loading fresh data rather than reusing the prefetch cache. Fixes #58969 Fixes #58723 Closes NEXT-1904 |
||
---|---|---|
.. | ||
.stats-app | ||
development | ||
e2e | ||
examples | ||
integration | ||
lib | ||
production | ||
unit | ||
.gitignore | ||
build-turbopack-tests-manifest.d.ts | ||
build-turbopack-tests-manifest.js | ||
get-test-filter.js | ||
jest-setup-after-env.ts | ||
ppr-tests-manifest.json | ||
readme.md | ||
test-file.txt | ||
tsconfig.json | ||
turbopack-tests-manifest.json |