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

import type { NextConfig } from 'next'
 
const nextConfig: NextConfig = {
  cacheComponents: true,
  partialPrefetching: true,
}
 
export default nextConfig

partialPrefetching requires cacheComponents. Without it, next dev and next build throw at config validation.

Reference

ValueDescription
trueEnables Partial Prefetching across the app.
falseDefault. 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-segment prefetch = '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

VersionChange
16.3.0partialPrefetching introduced. Requires cacheComponents to be enabled.

On this page