Problem Statement
How long does RTK Query keep unused data in cache by default?
Explanation
RTK Query keeps unused cached data for 60 seconds by default before removing it, which can be configured using the keepUnusedDataFor option at the API level or per endpoint. This automatic cache cleanup prevents memory leaks while ensuring frequently accessed data remains available, and the timer resets if the data gets used again within the window. You can adjust this duration based on your application's needs, using longer times for more stable data or shorter for rapidly changing data.
