`use cache` vs `unstable_cache` in Next.js 16: When to Use Which
use cacheunstable_cacheNext.js 16

`use cache` vs `unstable_cache` in Next.js 16: When to Use Which

Published March 29, 2026
9 min read
Salman Izhar

use cache vs unstable_cache in Next.js 16: When to Use Which

If you want the short answer, here it is: for most new Next.js 16 code, prefer use cache. Keep unstable_cache only where older code already depends on it or where you are doing an incremental migration.

That answer lines up with the official docs:

  • the use cache docs position it as the current caching directive
  • the unstable_cache docs explicitly say the API will be replaced by use cache when that API reaches stability

Sources:

So the real question is not "which one exists?" The real question is which one fits the current Next.js 16 mental model and creates less migration debt later?

What use cache Is Good At

The official docs say use cache can be applied at the file, component, or function level.

That makes it a much better fit for the Cache Components model because you can decide that:

  • a page should be cached
  • a nested component should be cached
  • a specific server-side function should be cached

That flexibility matters in real apps where some parts of the route are reusable and some are request-time.

For most new work, use cache is the better default because it aligns with how Next.js 16 wants you to think about caching.

What unstable_cache Is Still Good At

unstable_cache is still useful when you already have older code using it and you need an incremental path instead of a full caching redesign.

That is the practical case for it.

It can still help when you need to cache expensive server-side work in legacy code paths, but the important detail is where the docs point the future:

unstable_cache is not the long-term direction.

If you keep expanding around it for new work, you are building additional migration debt into the app.

The Best Default for New Code

Choose use cache when:

  • you are building new Next.js 16 features
  • you want the code to match the Cache Components model
  • you may want to cache a page, component, or function
  • you want your newer code to align with where the framework is going

Choose unstable_cache only when:

  • existing code already depends on it
  • you need a bridge during migration
  • rewriting the cache design right now would slow down a more important launch

That is the pragmatic answer most teams need.

A Simpler Way to Think About the Difference

use cache

Think of this as the current framework-native way to say:

"this work is stable enough to reuse."

It fits the new model better because it works naturally with Cache Components and clearer rendering boundaries.

unstable_cache

Think of this as:

"this older server-side cache helper still works, but it is not where the framework wants new code to grow."

That is why the docs wording matters so much.

When use cache Wins Clearly

Case 1: new marketing or documentation routes

If you are building new landing pages, docs pages, or case-study pages in Next.js 16, using the newer caching model is usually the cleanest choice.

Case 2: mixed routes with stable and request-time sections

If part of the route is reusable but other parts must stay dynamic, use cache gives you a better vocabulary for expressing that.

Case 3: code you expect to maintain for a long time

For long-lived code, the future direction of the framework matters. You do not want to explain in two quarters why brand-new features were built on an API the docs already positioned as transitional.

When Keeping unstable_cache Is Reasonable

Case 1: legacy code already works

If the current behavior is correct, the invalidation story is clear, and the team is busy with other higher-value work, do not create churn just to chase aesthetic purity.

Case 2: migration is happening in slices

You might:

  • upgrade framework version now
  • audit route behavior next
  • move individual cache boundaries later

That is a valid path.

Case 3: the route architecture is still unclear

If the team does not yet know what should be cached, shifting APIs alone will not fix the problem. Sometimes the right choice is to document the route behavior first, then migrate the caching layer once the architecture is clearer.

The Mistake to Avoid

The worst outcome is not using unstable_cache.

The worst outcome is:

  • keeping old cache helpers
  • adding new use cache usage randomly
  • never deciding what the route model should be

That creates a mixed vocabulary where nobody knows:

  • what is cached
  • how long it stays cached
  • what invalidates it
  • what should have stayed request-time

That is not a caching strategy. That is drift.

How I Migrate from unstable_cache to use cache

Use this order:

1. classify the route or function

Decide whether the work is:

  • shared and reusable
  • request-specific
  • mutation-sensitive
  • safe to stay stale briefly

2. find the real cache boundary

Do not migrate API by API without understanding the boundary.

Sometimes the correct replacement is:

  • cache the page
  • cache a component
  • cache a function
  • or not cache at all

3. document invalidation expectations

For every cache boundary, define:

  • what makes the output wrong
  • who changes that data
  • how fast the new value must appear

4. migrate the easiest low-risk paths first

Marketing pages and stable CMS-driven content usually migrate more cleanly than dashboards or mutation-heavy product flows.

When You Should Not Cache

This is just as important as the API choice.

Avoid both use cache and unstable_cache when the output depends on:

  • cookies
  • headers
  • authenticated session details
  • request-specific locale or geo behavior
  • data that must always be fresh per request

In those cases, let the work stay request-time and use Suspense or route design to keep the UX clean.

A Practical Decision Rule

Use this rule inside teams:

  • new code: default to use cache
  • old stable code: keep unstable_cache until there is a clear migration reason
  • unclear route behavior: pause and define the architecture before changing cache helpers

That rule prevents both reckless rewrites and silent legacy sprawl.

Final Takeaway

If you are writing new Next.js 16 code, use cache is usually the right default.

unstable_cache still has a place in mature codebases, but it should behave like a temporary bridge, not the foundation of your next year of architecture.

Choose the API that matches the direction of the framework and the reality of the route. That is the decision that will age well.

Migration Audit

Need help upgrading a production Next.js app?

I help teams clean up rendering boundaries, caching bugs, and migration regressions without turning an upgrade into a rewrite.

S

Written by Salman Izhar

Full Stack Developer specializing in React, Next.js, and building high-converting web applications.

Learn More