State Management · Middle · Question 35 of 75
When does RTK Query remove unused data from its cache?
- ✓Correct answer: After
keepUnusedDataForseconds (60 by default) without subscribers - 2Immediately after the last component unmounts
- 3Never - data stays until a page reload
Explanation
RTK Query counts hook subscriptions per endpoint and argument. If something subscribes again within that time, data comes from the cache. The TanStack Query counterpart is gcTime.