4 Replies
extended-salmon•17mo ago
Read the documentation
conscious-sapphire•17mo 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
conscious-sapphire•17mo 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...
conscious-sapphire•17mo ago
i hope this helps