Next.jsCachingError Fix2026 Updated

Next.js Fetch Not Caching— force-cache vs no-store [Fixed 2026]

Also covers: Next.js 15 caching defaults · revalidate · revalidateTag · unstable_cache · ISR

January 20267 min readNext.js 14/15 · App Router · React 19

⚡ The Problem

Error
// Data fetched on every request — page never statically cached
// Next.js 15 changed the default from force-cache → no-store

// Before (Next.js 14 default = cached):
fetch("https://api.example.com/products")  // was cached

// After (Next.js 15 default = not cached):
fetch("https://api.example.com/products")  // now dynamic!

✅ Fix — explicitly opt into caching

app/products/page.tsx
// Opt into caching explicitly in Next.js 15
const res = await fetch("https://api.example.com/products", {
  next: { revalidate: 3600 },  // revalidate every hour
})
const products = await res.json()

How Next.js Fetch Caching Works (and Changed in v15)

Next.js extends the native fetch API with a built-in data cache. In Next.js 14 and earlier, every fetch call was cached by default (force-cache). In Next.js 15, this default changed to no-store — meaning all routes are dynamic unless you explicitly opt into caching.

This change was made to avoid surprising developers with stale data, but it also means existing apps that relied on the default caching behaviour will suddenly hit their APIs on every request after upgrading.

1

Explicitly Set cache: 'force-cache'

Static data — product catalogue, blog posts, config
1 min

For data that rarely changes, pass cache: 'force-cache' to cache the response until you manually revalidate it.

app/products/page.tsx
export default async function ProductsPage() {
  // Cached indefinitely — revalidate manually with revalidateTag
  const res = await fetch("https://api.example.com/products", {
    cache: "force-cache",
    next: { tags: ["products"] },
  })
  const products = await res.json()
  return <ProductList products={products} />
}

// Or set a default for the whole route:
export const fetchCache = "force-cache"  // applies to all fetches in this file
2

Use next.revalidate for Time-Based Caching (ISR)

Data changes periodically — news, prices, inventory
2 min

Incremental Static Regeneration (ISR) caches the response for N seconds, then re-fetches in the background on the next request. This is the sweet spot between static and dynamic for most content.

Per-fetch revalidate
// Cache for 60 seconds — serves cached version, refreshes in background
const res = await fetch("https://api.example.com/prices", {
  next: { revalidate: 60 },
})

// Cache for 1 hour
const res2 = await fetch("https://api.example.com/blog", {
  next: { revalidate: 3600 },
})
Route-level revalidate (applies to all fetches in the file)
// app/blog/page.tsx
export const revalidate = 3600  // revalidate entire route every hour

export default async function BlogPage() {
  const posts = await fetch("https://api.example.com/posts").then(r => r.json())
  return <PostList posts={posts} />
}
3

Use Cache Tags with revalidateTag

On-demand revalidation after mutations
3 min

Tag your fetch calls with next: { tags: ['name'] } then call revalidateTag('name') in a Server Action to purge exactly that data without rebuilding the entire page.

app/products/page.tsx — tag the fetch
const res = await fetch("https://api.example.com/products", {
  next: {
    revalidate: 3600,
    tags: ["products"],  // ← tag for on-demand revalidation
  },
})
const products = await res.json()
app/actions.ts — revalidate on mutation
"use server"
import { revalidateTag } from "next/cache"

export async function createProduct(formData: FormData) {
  const name = formData.get("name") as string
  await db.product.create({ data: { name } })

  revalidateTag("products")  // ← purges all fetches tagged "products"
}
4

Fix Caching for Non-fetch Data (Prisma, DB queries)

unstable_cache — wrap any async function
3 min

The Next.js fetch cache only works with fetch(). For Prisma queries, SDK calls, or any server-side data source, use unstable_cache to apply the same caching behaviour.

lib/cached-queries.ts
import { unstable_cache } from "next/cache"
import { db } from "@/lib/db"

// Wrap Prisma query with caching
export const getProducts = unstable_cache(
  async () => {
    return db.product.findMany({ orderBy: { createdAt: "desc" } })
  },
  ["products-list"],         // cache key
  {
    revalidate: 3600,        // revalidate every hour
    tags: ["products"],      // tag for on-demand revalidation
  }
)

// Use it in a Server Component
export default async function ProductsPage() {
  const products = await getProducts()  // cached!
  return <ProductList products={products} />
}

unstable_cache is stable in production despite its name. The 'unstable_' prefix means the API may change in future versions, not that it is unreliable.

5

Force Dynamic Rendering with no-store

User-specific or real-time data — dashboards, live prices
1 min

For data that must be fresh on every request (user sessions, live scores, personal dashboards), use cache: 'no-store' or set export const dynamic = 'force-dynamic' at the route level.

app/dashboard/page.tsx
// Option A — per-fetch no-store
const res = await fetch("https://api.example.com/user/stats", {
  cache: "no-store",  // always fresh
})

// Option B — force the entire route to be dynamic
export const dynamic = "force-dynamic"

export default async function DashboardPage() {
  const stats = await fetch("https://api.example.com/user/stats").then(r => r.json())
  return <Dashboard stats={stats} />
}

Prevention

Frequently Asked Questions

Why did Next.js fetch caching change in version 15?+
Next.js 15 changed the default fetch cache from 'force-cache' (cache everything) to 'no-store' (never cache). This means all fetch calls are now dynamic by default. You must explicitly opt into caching with cache: 'force-cache' or next: { revalidate: N }.
What is the difference between force-cache and no-store?+
force-cache caches the response indefinitely until manually revalidated — good for static data like product catalogue or blog posts. no-store never caches and always fetches fresh data — good for user-specific or real-time data like dashboards or stock prices.
How do I cache fetch responses in Next.js 15?+
Pass cache: 'force-cache' or next: { revalidate: 3600 } as the second argument to fetch(). For example: fetch(url, { next: { revalidate: 3600 } }) caches the response for one hour and then re-fetches in the background.
What is unstable_cache and when should I use it?+
unstable_cache wraps any async function (not just fetch) with Next.js caching. Use it for database queries, Prisma calls, or any server-side data source that is not a fetch request. It supports the same revalidate and tags options as the fetch cache.
Why is my static page fetching data on every request?+
In Next.js 15, the default changed to no-store. Add cache: 'force-cache' to your fetch calls or add export const revalidate = 3600 at the top of your page file to restore static/ISR behaviour for the entire route.
How do I revalidate cached data on demand?+
Use revalidatePath(path) or revalidateTag(tag) inside a Server Action or API route handler. First tag your fetch with next: { tags: ['products'] }, then call revalidateTag('products') after a data mutation to purge just that cached data.

Need Expert Help?

We Build Fast, Cached Next.js Applications

Softplix engineers architect Next.js apps with optimal caching strategies for performance and scalability. Need help with your App Router data layer? Let us help.

Talk to an Engineer