No way to know if the data was served from cache. #1984
Replies: 4 comments 7 replies
-
I don’t think so. What do you need it for? |
Beta Was this translation helpful? Give feedback.
-
same question here |
Beta Was this translation helpful? Give feedback.
-
A cache miss is shown when a query goes into loading state. If you mount a new component and it gets data immediate from the cache, it will be in success state. |
Beta Was this translation helpful? Give feedback.
-
Hi @TkDodo. It's a specific case, but I guess this kind of flexibility would benefit developers. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently there's no property in the response object which tells me if the data was served from cache or if it had to execute the queryFn to return the response.
IIRC, previous version had an
isCached
flag which provided this information.I tried to use
isFetched
flag. But it's set to true in both cases.Is there something in the response object that can be used to determine if the data was served from cache?
Beta Was this translation helpful? Give feedback.
All reactions