rsnext/test
Zack Tanner b9861fd2cd
only prefix prefetch cache entries if they vary based on Next-URL (#61235)
### What
Prefetches to pages within a shared layout would frequently cache miss
despite having the data available. This causes the "instant navigation"
behavior (with the 30s/5min TTL) to not be effective on these pages.

### Why
In #59861, `nextUrl` was added as a prefetch cache key prefix to ensure
multiple interception routes that correspond to the same URL wouldn't
clash in the prefetch cache. However this causes a problem in the case
where you're navigating between sub-pages. To illustrate the issue,
consider the case where you load `/foo`. This will populate the prefetch
cache with an entry of `{foo: <PrefetchCacheNode}`. Navigating to
`/foo/bar`, with a link that prefetches back to `/foo`, will now result
in a new cache node: `{foo: <PrefetchCacheNode>, /foo/bar%/foo:
<PrefetchCacheNode>}` (where `Next-URL` is `/foo/bar`). Now we have a
cache entry for the full data, as well as a cache entry for a partial
prefetch up to the nearest loading boundary. Now when we navigate back
to `/foo`, the router will see that it's missing data, and need to
lazy-fetch the data triggering the loading boundary.

This was especially noticeable in the case where you have a route group
with it's own loading.js file because it creates a level of hierarchy in
the React tree, and suspending on the data fetch would result in the
group's loading boundary to be triggered. In the non-route group
scenario, there's still a bug here but it would stall on the data fetch
rather than triggering a boundary.

### How
In #61794 we conditionally send `Next-URL` as part of the `Vary` header
if we detect it could be intercepted. We use this information when
creating the prefetch entry to prefix it, in case it corresponds with an
intercepted route.

Closes NEXT-2193
2024-02-13 15:03:37 +00:00
..
.stats-app chore: Update pnpm v8.14.2 to 8.15.1 (#61807) 2024-02-09 21:46:19 +00:00
development Update app-index to only ever construct the initial data response once (#61869) 2024-02-09 13:44:51 -08:00
e2e only prefix prefetch cache entries if they vary based on Next-URL (#61235) 2024-02-13 15:03:37 +00:00
examples feat(cli): introduce --tailwind flag (#46927) 2023-03-16 16:06:27 +01:00
integration fix(next/image): improve warning when fill and sizes="100vw" (#61949) 2024-02-12 17:32:39 +00:00
lib test(fixture): separate pnpm cache for the test installation (#61783) 2024-02-08 13:53:42 -08:00
production chore(test): switch a few tests from yarn to pnpm (#61793) 2024-02-09 15:11:52 +01:00
unit fix:(next/image) handle remotePatterns with a dot in the pathname (#60488) 2024-02-08 18:21:29 -05:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-tests-manifest.d.ts Update Turbopack test manifest from GitHub Actions artifact (#58394) 2023-11-24 16:48:12 +01:00
build-turbopack-tests-manifest.js test(fixture): fix manifest update (#61970) 2024-02-12 15:26:30 -08:00
get-test-filter.js run tests from test suite that are not listed in the manifest (#58401) 2024-01-11 07:38:35 +00:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
ppr-tests-manifest.json Navigation Signals in PPR (#60450) 2024-02-06 12:25:50 -07:00
readme.md
test-file.txt
tsconfig.json chore: extends from shared base tsconfig (#59776) 2023-12-19 18:52:22 +01:00
turbopack-tests-manifest.json test(fixture): fix manifest update (#61970) 2024-02-12 15:26:30 -08:00

See Testing for more information on how you can run/write/debug tests for Next.js.