Next.js Discord

Discord Forum

Behavior of Fetch Request Caching

Answered
Siamese Crocodile posted this in #help-forum
Open in Discord
Siamese CrocodileOP
Hello! I'm posting this to ask a question about the caching behavior of fetch requests in my Next.js 14.2.5 project.

Let's say I have a dynamic route [slug] that calls an API on the server side. If I set cache validation for 15 minutes, will the first dynamic route [slug] generated on the server side cause all other dynamic routes [slug] generated within the following 15 minutes to reuse the same API call?
Thanks !
Answered by B33fb0n3
if there is a dynamic page and only the one fetch request does have the revalidation time of 15 minutes, then the page itself will still be dynamically served, but while generating that dynamic response the server takes the cached result from the fetch
View full answer

3 Replies

Answer
Siamese CrocodileOP
Oh ok thanks a lot !
sure thing