Does the Vercel Data Cache (aka fetch cache) cache error responses? #57792
Replies: 3 comments
-
It looks like that fetch calls which result in an error are cached by default. In our case this leads to cached 404 pages if the server did not respond in time or has an hickup. Maybe there is a possibility to prevent those fetch calls to be cached but I do not know how. It would be great if someone with experience in this field could enlighten me. |
Beta Was this translation helpful? Give feedback.
-
Yes it looks like error responses are cached in my case |
Beta Was this translation helpful? Give feedback.
-
Did anyone get anywhere with this? Also using GraphQL and an error response persists when what we want is for it ideally retry. Currently thinking to use no-cache and handle it myself on the server with Redis so I have control over what is cached and what isn't. |
Beta Was this translation helpful? Give feedback.
-
If not, how does it determine that there was an error, and how can we configure this (since, for example, GraphQL endpoints always return 200, we can't rely solely on status code)?
If so, can anyone explain the reasoning behind caching error responses? This is most certainly not what I want, as it can turn an intermittent error into a persistent one.
Beta Was this translation helpful? Give feedback.
All reactions