I'm having an issue where my app is removing OK responses from the cache and returning 404 if the backend is down.
Currently, cache
and revalidate
time are the same.
I need to cache these requests until new data comes OK (i.e. HTTP 200).
React query has cache
time and revalidate
time as options, I'm wondering if I should put cache time to unlimited if possible, and revalidate with the normal 10 minutes time.
queryFn
, if the data is not as expected, throw an error. React Query will not update the cache if it throws.