Fetch Cache and 404 status code
Unanswered
Posavac Hound posted this in #help-forum
Posavac HoundOP
Is someone able to confirm my understanding that when
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.
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 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.
i haven't personaly tested it (it should be simple tho), but i believe the error codes (ie 4xx) should not be cached as they are an "error"
@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