4 Replies
quickest-silver•2y ago
Read the documentation
harsh-harlequin•2y ago
gc time is when query cache is cxompletel cleared
so its garbage collected
no longer there
staleTime means when to trigger refetch
but cache is still there
so staletime means
how long do u wanna serve the cached data
gc time is completely removing the key from cache
garbage collection
harsh-harlequin•2y ago
Tiger's Place
gcTime in TanStack Query explained
Introduction
I had a bit of a tough time understanding gcTime in TanStack Query. So I decided to write this post for myself.
Every query is cached
When you fetch data using Tanstack Query, the data is cached so that the following requests can be serv...
harsh-harlequin•2y ago
i hope this helps