Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Next.js 15 Caching Explained: Why Your Data Keeps Showing as Stale

DEV Community·Mahdi BEN RHOUMA·about 1 month ago
#OdS71k5X
#nextjs#caching#approuter#cache#const#posts
Reading 0:00
15s threshold

Next.js 15 Caching Explained: Why Your Data Keeps Showing as Stale If you upgraded from Next.js 14 to 15 and your pages suddenly stopped refreshing — or started hitting your database on every request — you are not alone. The caching model changed fundamentally. This is the guide I wish existed when I spent a day debugging it. What Changed in Next.js 15 In Next.js 14, fetch() inside Server Components was cached by default: // Next.js 14: this was CACHED (force-cache) const data = await fetch ( ' https://api.example.com/posts ' ); Enter fullscreen mode Exit fullscreen mode In Next.js 15, the default flipped: // Next.js 15: this is NOT cached (no-store) const data = await fetch ( ' https://api.example.com/posts ' ); Enter fullscreen mode Exit fullscreen mode This single change affects every Server Component in your app that uses fetch() . If you were relying on the default cache behavior, your routes are now fully dynamic — which means a database call on every render.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More