T
TanStack15mo ago
adverse-sapphire

Trying to disable caching (with gcTime & staleTime) does not seem to work

Im trying to disable cache for some queries, or all queries, but no luck so far. I have tried setting gcTime: 0 and staleTime: 0. Additionally, if i call manually refetch, it hits also cache always. Is it possible to force fetching new data somehow?
No description
3 Replies
adverse-sapphire
adverse-sapphireOP15mo ago
No description
harsh-harlequin
harsh-harlequin15mo ago
what do you mean by "disable caching" ? disk cache is a browser level cache that's influenced by your cache-control headers, it has nothing to do with react-query if you see the request in the network tab of your browser devtools, query did it's job
adverse-sapphire
adverse-sapphireOP15mo ago
hmm that is true, thanks for pointing out

Did you find this page helpful?