Skip to content

docs: add unstable_cacheuse cache migration guide#92392

Draft
aurorascharff wants to merge 1 commit intocanaryfrom
docs/unstable-cache-migration-guide
Draft

docs: add unstable_cacheuse cache migration guide#92392
aurorascharff wants to merge 1 commit intocanaryfrom
docs/unstable-cache-migration-guide

Conversation

@aurorascharff
Copy link
Copy Markdown
Member

What?

Add a step-by-step migration section for unstable_cacheuse cache to the Migrating to Cache Components guide.

Why?

The unstable_cache API reference says "use use cache instead" but gives no migration path. There is no doc that maps revalidate: 3600cacheLife('hours'), tags: ['x']cacheTag('x'), and explains that keyParts are no longer needed. A developer or AI agent doing this migration has to piece these together from three separate API reference pages.

How?

  • Add an ## unstable_cache section to migrating-to-cache-components.mdx with Before/After code blocks (TSX/JSX switcher), matching the existing pattern used for dynamic, revalidate, and fetchCache
  • Add a link from the unstable_cache API reference to the new migration section

Improving Documentation

  • Run pnpm prettier-fix to fix formatting issues before opening the PR.
  • Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines.

Made with Cursor

The unstable_cache API reference says "use use cache instead" but
provides no step-by-step migration path. Add a section to the
Migrating to Cache Components guide showing the before/after pattern:
unstable_cache wrapper → use cache directive, revalidate → cacheLife,
tags → cacheTag, and automatic cache keys replacing keyParts.

Also add a link from the unstable_cache API reference to the new
migration section.

Made-with: Cursor
@nextjs-bot nextjs-bot added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants