Next.js Fetch Not Caching— force-cache vs no-store [Fixed 2026]
Also covers: Next.js 15 caching defaults · revalidate · revalidateTag · unstable_cache · ISR
⚡ The Problem
// 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
// 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.
Explicitly Set cache: 'force-cache'
Static data — product catalogue, blog posts, configFor data that rarely changes, pass cache: 'force-cache' to cache the response until you manually revalidate it.
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 fileUse next.revalidate for Time-Based Caching (ISR)
Data changes periodically — news, prices, inventoryIncremental 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.
// 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 },
})// 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} />
}Use Cache Tags with revalidateTag
On-demand revalidation after mutationsTag 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.
const res = await fetch("https://api.example.com/products", {
next: {
revalidate: 3600,
tags: ["products"], // ← tag for on-demand revalidation
},
})
const products = await res.json()"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"
}Fix Caching for Non-fetch Data (Prisma, DB queries)
unstable_cache — wrap any async functionThe 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.
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.
Force Dynamic Rendering with no-store
User-specific or real-time data — dashboards, live pricesFor 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.
// 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
- After upgrading to Next.js 15, audit all fetch calls — the default changed from force-cache to no-store
- Set cache behaviour explicitly on every fetch call — never rely on defaults between major versions
- Use next: { tags: ['name'] } on every cached fetch so you can revalidate precisely after mutations
- Use unstable_cache for Prisma and database queries — they are not covered by the fetch cache
- Set export const revalidate = N at route level to apply a consistent strategy to all fetches in that route
- Use export const dynamic = 'force-dynamic' for routes that serve user-specific or real-time data
Frequently Asked Questions
Why did Next.js fetch caching change in version 15?+−
What is the difference between force-cache and no-store?+−
How do I cache fetch responses in Next.js 15?+−
What is unstable_cache and when should I use it?+−
Why is my static page fetching data on every request?+−
How do I revalidate cached data on demand?+−
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