One flag turns the whole model on:
const nextConfig = {
cacheComponents: true,
partialPrefetching: true,
};
module.exports = nextConfig;next dev and next build confirm it in their first lines of output (- Cache Components enabled). partialPrefetching is separate but belongs with it: it lets the router prefetch a route's shell, which ISR needs.
The flag changes what a build failure means. Next.js 10,514 now refuses to produce a route it cannot prerender at all:
Error: Route "/broken": Next.js encountered uncached or runtime data during prerendering.
`fetch(...)`, `cookies()`, `headers()`, `params`, `searchParams`, or `connection()` accessed
outside of `<Suspense>` prevents the route from being prerendered, blocking the page load and
leading to a slower user experience.
Ways to fix this:
- [stream] Provide a placeholder with `<Suspense fallback={...}>` around the data access
- [cache] For uncached data (`fetch`, database calls): cache the access with `"use cache"`
- [block] Set `export const instant = false` to allow a blocking routeThose three fixes are the whole decision tree. If the data is the same for everybody, cache it. If it is per-request, put a <Suspense> boundary above it so the fallback can ship in the shell. If the route genuinely has to block — a redirect gate, say — export const instant = false says so deliberately.
Adopt it route by route. The flag is global, but a route that already keeps its request-time reads inside <Suspense> boundaries — the structure Streaming with Suspense recommends for streaming — usually builds unchanged, and the routes that fail name the unbounded data access.