nextjs - 💡(How to fix) Fix Cache components does not work on dynamic segments when localized [6 comments, 5 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#86870Fetched 2026-04-08 02:08:43
View on GitHub
Comments
6
Participants
5
Timeline
20
Reactions
1
Author
Timeline (top)
subscribed ×8commented ×6mentioned ×4issue_type_added ×1

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:03 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8112
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.0.7 // Latest available version is detected (16.0.7).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/maxscn/intlayer-cache-components

To Reproduce

  1. Start the dev server.
  2. Go to /en/static (cached) and then /en/static/1 (not cached)
  3. Go to /static (cached) and then /static/1 (cached)

Current vs. Expected behavior

Following the steps, I expected the localized content to work exactly as the non-localized content. The locale is known at build time hence it should be possible to cache even the localized pages.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:03 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8112
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.0.7 // Latest available version is detected (16.0.7).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

cacheComponents, internationalization (i18n)

Which stage(s) are affected? (Select all that apply)

next build (local), next dev (local), Vercel (Deployed)

Additional context

Every big localization framework which works with react server components (I have tried intlayer, next-intl and lingui), breaks when using it with cache components. The reason that they break seems to be that we are accessing params, which forces the route to be dynamic. Even if I cache the locale param at the layout level, when I access my params at page level I opt out since that is an asynchronous call. The result is that if you translate any content at all (in server components), your entire page becomes dynamic. All of the big localization framework demands that you do this to translate server side components.

extent analysis

TL;DR

  • The issue can be mitigated by re-evaluating how localization parameters are accessed and cached in server components to avoid forcing routes to be dynamic.

Guidance

  • Review the localization framework's documentation to understand how to properly cache localized content without making the entire page dynamic.
  • Investigate alternative methods for accessing localization parameters that do not involve asynchronous calls, which may allow for more efficient caching.
  • Consider modifying the caching strategy to account for the dynamic nature of localized server components, potentially by caching at a higher level or using a different caching mechanism.
  • Evaluate the trade-offs between caching and localization, as the current approach may require compromises in terms of performance or functionality.

Notes

  • The issue appears to be related to the interaction between localization frameworks and cache components in Next.js, and a solution may require a deep understanding of both technologies.
  • The provided environment information and package versions may be relevant in troubleshooting the issue, but do not immediately suggest a clear solution.

Recommendation

  • Apply workaround: Given the complexity of the issue and the potential trade-offs involved, applying a workaround that balances caching and localization requirements may be the most practical solution.

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