Next.js Discord

Discord Forum

Caching updates from Next14 to 15 regarding `revalidate`

Unanswered
Chien Français Blanc et Noir posted this in #help-forum
Open in Discord
Avatar
Chien Français Blanc et NoirOP
In my API routes I got into the habit of doing: export const revalidate = 0 at the top of the file due to the fact that GET requests were cached automatically in Next14. But now that Next 15 you have to specifically opt-in to caching GET routes on route handlers, does that mean I can safely remove these revalidate = 0 config settings on each of my api routes?

2 Replies

Avatar
Chien Français Blanc et NoirOP
Avatar
yeah, I tried this on a new project and it seems like it. You can savely remove revalidate = 0 and it will be dynamic by default.
https://x.com/alfonsusac/status/1867747169710772389