nextjs - 💡(How to fix) Fix docs: Document `experimental.cachedNavigations` feature [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#92268Fetched 2026-04-08 02:32:38
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×2closed ×1labeled ×1locked ×1

The experimental.cachedNavigations feature is currently undocumented. After reverse-engineering the Next.js 16.2.1-canary.17 source code, I've compiled a comprehensive understanding of this feature that could benefit the community and warrants official documentation.

Error Message

  1. Validation: Throws error E1089 if enabled without cacheComponents: true.

Root Cause

The experimental.cachedNavigations feature is currently undocumented. After reverse-engineering the Next.js 16.2.1-canary.17 source code, I've compiled a comprehensive understanding of this feature that could benefit the community and warrants official documentation.

Code Example

// next.config.ts
const nextConfig: NextConfig = {
  cacheComponents: true, // Required prerequisite
  experimental: {
    cachedNavigations: true,
  },
};

---

__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS=true
RAW_BUFFERClick to expand / collapse

Description

The experimental.cachedNavigations feature is currently undocumented. After reverse-engineering the Next.js 16.2.1-canary.17 source code, I've compiled a comprehensive understanding of this feature that could benefit the community and warrants official documentation.

What is cachedNavigations?

An experimental feature that enables staged RSC rendering with client-side segment caching. When enabled (requires cacheComponents: true), the server splits RSC Flight responses into static and dynamic stages, allowing the client to cache static portions and serve them instantly on repeat navigations while streaming only the dynamic parts.

Configuration

// next.config.ts
const nextConfig: NextConfig = {
  cacheComponents: true, // Required prerequisite
  experimental: {
    cachedNavigations: true,
  },
};

Also supports environment variable override:

__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS=true

Key Technical Details Found

  1. Staged Rendering Pipeline: When enabled, generateStagedDynamicFlightRenderResult() is called instead of generateDynamicFlightRenderResult(), enabling a multi-stage render (Static → EarlyRuntime → Dynamic) via StagedRenderingController.

  2. Marker Byte Protocol: Server prepends a single control byte to RSC Flight response streams:

    • 0x23 (#) = Complete response (fully cacheable)
    • 0x7e (~) = Partial response (has dynamic content)
  3. Static Byte Length: Server calculates staticStageByteLength — the byte offset where static content ends, sent as l field in RSC payload for client-side cache boundary detection.

  4. StaleTimeIterable: A buffered async iterable that streams per-component stale time values during rendering, enabling granular cache TTL per segment.

  5. Client-side: stripIsPartialByte() removes the marker, then stream.tee() branches the response between React rendering and the segment cache for future navigations.

  6. Validation: Throws error E1089 if enabled without cacheComponents: true.

Source Files Referenced

FilePurpose
dist/esm/server/app-render/app-render.jsMain orchestration
dist/esm/server/app-render/staged-rendering.jsStagedRenderingController
dist/esm/server/app-render/stale-time.jsStaleTimeIterable
dist/esm/server/config-schema.js:221Zod validation
dist/esm/client/components/segment-cache/cache.jsstripIsPartialByte, getStaleAt
dist/esm/client/components/router-reducer/fetch-server-response.jsResponse teeing
dist/esm/build/define-env.js:71Env variable setup

Request

Could documentation be added for this feature? Specifically:

  1. What it does — Staged RSC rendering with segment caching
  2. Configuration — Config option + env var + prerequisites
  3. How it works — Marker byte protocol, static/dynamic split
  4. When to use it — Performance characteristics and ideal use cases
  5. Interaction with other featuresstaleTimes, prefetchInlining, dynamicOnHover, partialFallbacks

Environment

  • Next.js: 16.2.1-canary.17
  • Node.js: v25.8.2
  • OS: Linux (Debian)

Which area(s) are affected?

Documentation

Additional context

I'm running a production enterprise CMS (LOUST.PRO) on Next.js 16.2 canary and discovered this feature while reviewing the experimental config options. The source code reveals a sophisticated implementation that is clearly functional but has zero documentation. Given that cacheComponents is already stable and promoted to root-level config, cachedNavigations seems like the natural next step that users would want to enable for performance gains.

I've also documented interactions with partialFallbacks (build-time companion), unstable_instant (runtime prefetch integration), and the staleTimes config (TTL control).

extent analysis

TL;DR

The experimental.cachedNavigations feature in Next.js 16.2.1-canary.17 can be enabled with cacheComponents: true to improve performance through staged RSC rendering with client-side segment caching.

Guidance

  • To enable the feature, set experimental.cachedNavigations to true in next.config.ts and ensure cacheComponents is also true.
  • Verify the feature is working by checking for the presence of the marker byte protocol (0x23 or 0x7e) in RSC Flight response streams.
  • Understand the performance characteristics and ideal use cases for the feature to determine when to use it.
  • Be aware of interactions with other features like staleTimes, prefetchInlining, dynamicOnHover, and partialFallbacks.

Example

// next.config.ts
const nextConfig: NextConfig = {
  cacheComponents: true,
  experimental: {
    cachedNavigations: true,
  },
};

Notes

The feature is currently undocumented, but the provided configuration and technical details can help users understand and utilize it.

Recommendation

Apply the workaround by enabling the feature with the required configuration, as it seems to be a functional and performance-enhancing addition to Next.js.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix docs: Document `experimental.cachedNavigations` feature [2 comments, 3 participants]