You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cache's TTL can vary significantly, for instance, between 5 minutes and 1 day. It's challenging to determine a single, unified refreshThreshold setting for all use cases. Therefore, adding a separate refreshThreshold parameter to the wrap function could be a valuable enhancement.
The text was updated successfully, but these errors were encountered:
@eternasuno - can you give a couple examples of this use case?
For example, I cached an authentication token, which expires after 2 hours. Therefore, the refreshThreshold should be set to 0. On the one hand, I have some caches that need to update their expiration time, but they cannot do so when there is only a unified refreshThreshold.
lchenay
added a commit
to lchenay/node-cache-manager
that referenced
this issue
Dec 29, 2023
I think the need of refreshThreshold parameter is linked to what is the right usage of cache-manager.
If you have only 1 instance of cache, then finding global refreshThreshold value is hard. Some people may create 1 instance per type of cache ; and so using hard coded as default value ttl / refreshThreshold are not an issue in this case.
The cache's TTL can vary significantly, for instance, between 5 minutes and 1 day. It's challenging to determine a single, unified refreshThreshold setting for all use cases. Therefore, adding a separate refreshThreshold parameter to the wrap function could be a valuable enhancement.
The text was updated successfully, but these errors were encountered: