CodePark/ questions / Route handlers & middleware
START PRACTICINGPRACTICE
Frontend question · Next.js › Route handlers & middleware

In Next.js 15, how are GET Route Handlers cached by default?

They are not cached by default; opt in with export const dynamic = "force-static"

Next.js 15 changed GET Route Handlers to uncached by default. You can opt a handler into static rendering with export const dynamic = "force-static" or a revalidate export. The tempting "They are cached by default, as in Next.js 14" is wrong because that was the old default, which version 15 changed.