partialPrefetching
Configure the default link prefetch behavior to fetch only the static parts of each route.
partialPrefetching enables Partial Prefetching at the app level. The framework prefetches the static parts of each route by default; opt individual routes into runtime prefetching to fetch more.
Usage
partialPrefetching requires cacheComponents. Without it, next dev and next build throw at config validation.
Reference
| Value | Description |
|---|---|
true | Enables Partial Prefetching across the app. |
false | Default. No change to prefetch behavior. |
How prefetches resolve
With partialPrefetching enabled:
- Plain
<Link>prefetches the route's App Shell, shared across every link to the route. <Link prefetch={true}>prefetches the route's static shell with its cached content.<Link prefetch={true}>+ per-segmentprefetch = 'allow-runtime'prefetches a runtime prerender that includes cached content gated by runtime data.
See the runtime prefetching guide for the per-link behavior in detail.
Per-segment overrides
A segment that exports an explicit prefetch value overrides the app-level default for that route.
Version History
| Version | Change |
|---|---|
| 16.3.0 | partialPrefetching introduced. Requires cacheComponents to be enabled. |