Re:TanStack Query(a.k.a. React Query) v5 announced
by phronesis on Thursday October 19, 2023 @07:11AM
(#37941206)
It's a fair point that I agree with. I meant more in terms of, why not just name it `garbageCollectTime`.
Re:TanStack Query(a.k.a. React Query) v5 announced
by tkdodo on Thursday October 19, 2023 @10:00AM
(#37943040)
so cacheTime was really confusing because it seemed like "this is the amount time we cache data for", but that's not what it is. So a rename had to happen. We had some discussion on the public roadmap (https://github.com/TanStack/query/discussions/4252) about what it's gonna be. I'm usually against abbreviations, simply because there's always someone who doesn't understand what it means. But all other suggestions like inactiveCacheTime also had room for interpretation. gc is an abbreviation that is known well enough (think git gc), and it's also not an option that you will customize on a daily basis (usually once, globally).
A typical expectation would be that "cacheTime" controls how long react query uses the cached value before it tries to fetch that data again from the server. That part is actually controlled by "staleTime".