can caches cause memory leak? #3771
-
If I use cacheTime as Infinity, this can cause a memory leak on the app? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
the cache is just an object in javascript. We distribute it via react context through the Usually, in a single page application, you'll only have one I'm not really sure what a "memory leak" would be for you? |
Beta Was this translation helpful? Give feedback.
the cache is just an object in javascript. We distribute it via react context through the
QueryClientProvider
. Infinite CacheTime means we'll never remove it from the cache. So the data will stick around until you unmount yourQueryClientProvider
.Usually, in a single page application, you'll only have one
QueryClientProvider
at the top of your App. So that cache entry will stick around for the lifetime of your app.I'm not really sure what a "memory leak" would be for you?