Next.js Developer interview question · Most asked

How did caching defaults change in Next.js 15?

Summary

Next.js 15 made caching opt-in: fetch requests are no longer cached by default, GET Route Handlers are not cached by default, and the client Router Cache no longer reuses page segments (stale time 0) on navigation.

Longer Answer

In Next.js 14, fetch defaulted to force-cache, which surprised many developers with stale data. In 15 you explicitly opt in with cache: 'force-cache', next: { revalidate }, or segment config like export const dynamic = 'force-static'. Pages without dynamic APIs can still be statically pre-rendered at build time. Next.js 15 also made request APIs (cookies(), headers(), params, searchParams) asynchronous.

Key Points

  • fetch uncached by default in 15
  • GET Route Handlers uncached by default
  • Router Cache staleTime 0 for pages
  • Async cookies(), headers(), params

Explanation

What interviewers look for

Awareness that behavior differs by version, and how to opt in explicitly.

Common mistakes

  • Assuming Next 14 caching behavior in a Next 15+ app (or vice versa)

More most-asked Next.js Developer questions

← All Next.js Developer questions