Instant Navigation
Instant navigation means content appears the moment a user clicks a link. Achieve it by caching server-side data with 'use cache' and wrapping dynamic content in Suspense boundaries so they stream in without blocking.
What does "instant" mean?
A navigation is instant when static + cached content appears immediately on click, while dynamic content streams in via Suspense. The key insight: Next.js only re-renders below the shared layout on client navigations.
// A navigation is INSTANT when:
// ✅ Static + cached content appears immediately on click
// ✅ Server streams remaining (dynamic) content into Suspense fallbacks
// ✅ Layout is not re-fetched (only the changed part re-renders)
// Two paths to the same page:
// 1. Direct visit (page load) → gets full HTML from CDN
// 2. Client navigation (Link) → only re-renders below shared layout
// The key: Suspense boundaries below the shared layoutFull HTML from CDN. Root Suspense catches everything.
Only re-renders below shared layout. Only Suspense below that point fires.
Cached + dynamic content side by side
This page uses real server-side Suspense streaming. The items below stream in progressively — the fast one appears first, then the slow one, without blocking each other or blocking the rest of the page.
✅ The page didn't wait for the slow component — it streamed in independently. This is exactly how instant navigation works.
The instant product page
// app/store/[slug]/page.tsx
// ✅ This page navigates instantly because:
// - ProductInfo is cached with 'use cache'
// - Inventory is wrapped in Suspense (streams in)
// - Neither blocks the page from showing immediately
import { Suspense } from 'react'
export default function ProductPage(props: PageProps<'/store/[slug]'>) {
return (
<div>
<Suspense fallback={<p>Loading product...</p>}>
<ProductInfo params={props.params} /> {/* cached → instant */}
</Suspense>
<Suspense fallback={<p>Checking availability...</p>}>
<Inventory params={props.params} /> {/* fresh → streams in */}
</Suspense>
</div>
)
}
async function getProduct(slug: string) {
'use cache' // ← makes it instant
cacheLife('hours')
return db.products.findBySlug(slug)
}
async function ProductInfo({ params }) {
const { slug } = await params // ← async params (Next 16)
const product = await getProduct(slug) // ← hits cache
return <h1>{product.name}</h1>
}
async function Inventory({ params }) {
const { slug } = await params
const item = await db.inventory.findBySlug(slug) // ← always fresh
return <p>{item.count} in stock</p>
}Two common fixes
Cache Components (enabled via cacheComponents: true in next.config) validates every page automatically in dev. When it detects a blocking route, it shows a dev overlay insight with the exact component and fix cards.
// ❌ BLOCKING: fetches at top level block the page
export default async function ProductPage(props) {
const featured = await getFeatured() // blocks if uncached!
const { slug } = await props.params // suspends
const product = await fetch(...) // also blocks
// ...
}
// ✅ FIX 1: Move slug-dependent work into Suspense
export default async function ProductPage(props) {
const featured = await getFeatured() // still here, but we'll fix this too
return (
<div>
<FeaturedSection items={featured} />
<Suspense fallback={<p>Loading product...</p>}>
<ProductInfo params={props.params} />
</Suspense>
</div>
)
}
// ✅ FIX 2: Cache the featured fetch
async function getFeatured() {
'use cache' // ← now it's part of the static shell!
cacheLife('hours')
return fetch('https://api.example.com/featured').then(r => r.json())
}Partial Prefetching
// Partial Prefetching (PPR): enabled automatically with cacheComponents
// Default: prefetches App Shell (lightweight, free)
<Link href="/checkout">Checkout</Link>
// Eager: also prefetch page content alongside shell
<Link href="/checkout" prefetch>
Checkout
</Link>
// With prefetch={true}: also opts into Runtime Prefetching
// → resolves per-link URL data (params, searchParams) ahead of clickinstant = false
// Opt-out: not every page needs to be instant
// Set instant = false to suppress validation warnings
// app/dashboard/layout.tsx
export const instant = false // ← opt this segment out
// With false on /dashboard/layout.tsx:
// - Navigations into /dashboard from outside are not validated
// - But navigations between /dashboard/a and /dashboard/b still are!