Next.js Discord

Discord Forum

Fetch Cache and 404 status code

Unanswered
Posavac Hound posted this in #help-forum
Open in Discord
Posavac HoundOP
Is someone able to confirm my understanding that when fetch()ing something that 404's, that the result is not cached? I couldn't see this written down in the docs.

My use cases is that we are using catch-all routes which hit a CMS, and we are getting a lot of cache misses for pages that don't exist. Fetches for pages that exist cache fine, but those that 404 do not.

2 Replies

@Posavac Hound also, if you want to do this cache, id suggest loking into unstable_cache and possibly disabling the actual fetch cache for less usage