Prefetching runs only in production builds; under next dev the same page made no prefetch requests, even on hover. A <Link> prefetches when it enters the viewport, and again on hover if what it fetched has expired. prefetch={false} turns both off. What gets fetched depends on the route and the config:
- Without Cache Components: a static route is prefetched in full. A dynamic route gets everything down to its nearest
loading.js; with none, only its route tree and<head>metadata.prefetch={true}renders the whole route, dynamic data included, at prefetch time. - Cache Components on,
partialPrefetching: false: a dynamic route's prerendered static shell is prefetched, so it needs noloading.js.prefetch={true}is still the full render. partialPrefetching: true(16.3+, requires Cache Components;next buildfails without it): the default prefetch is the route's App Shell, its static and cached output that doesn't depend onparamsorsearchParams. Every link to/p/[id]shares one shell.prefetch={true}adds that link's URL data and the cached content behind it, but no longer prefetches uncached data; that streams after the click.
Requests go per segment: first the route tree, then each segment the client lacks, marked by Next-Router-Prefetch and Next-Router-Segment-Prefetch headers.
On a page with 20 links to /p/1…/p/20 (Next.js 16.4.5, next start, the same counts in Chrome 156 and Firefox 159), prefetch requests to /p/*:
- Cache Components off: 24 (4 route trees, then 20 per-link metadata requests)
- on,
partialPrefetching: false: 8 (4 trees, 4 copies of the same page shell) - on,
partialPrefetching: true: 5 (4 trees, 1 shared shell)
The docs say both flags become the default, and are removed, in the next major.