Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Fix misleading information in the docs about mixing cached and uncached
fetch
calls during dynamic rendering.Why?
I followed the guide (using Next.js 15.3.2) and tried it out with this code:
After building and starting the production server, when I refresh the page, both
jokeData.value
andjokeData2.value
are different, uncached. If I want the otherfetch
to be cached, I need to explicitly enable caching, e.g.This way the first fetch is not cached while the second one is.
How?
The previous version claimed:
But below in the guide, we can see this:
So the first citation is misleading - the fetch requests are not cached by default (with dynamic rendering - static rendering would cache the single call it into the output), so we actually need to explicitly enable caching to have them cached.