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
This was sort of raised in #300, but it's something I've been wanting to do for a while.
Right now there is an LRW eviction policy, which acts as an evented system for pruning records when the cache is too large. As such it's extremely accurate on keeping the cache below bounds. This comes at a cost of message passing (as it acts as a hook).
We can provide the same, except that it runs on a timer instead of acting as a hook. This will be less accurate, but there will be far lower memory used by the actual policy. You are effectively trading lower policy memory for potential bursts in memory as your cache goes over the limit.
It is important to document the difference between the hooks, and their tradeoffs. I'm not sure how to name the new policies, perhaps we have Cachex.Policy.LRW.Evented and Cachex.Policy.LRW.Timed, and we alias Cachex.Policy.LRW through to the evented version (so we can ship this in a minor version bump).
The text was updated successfully, but these errors were encountered:
This was sort of raised in #300, but it's something I've been wanting to do for a while.
Right now there is an LRW eviction policy, which acts as an evented system for pruning records when the cache is too large. As such it's extremely accurate on keeping the cache below bounds. This comes at a cost of message passing (as it acts as a hook).
We can provide the same, except that it runs on a timer instead of acting as a hook. This will be less accurate, but there will be far lower memory used by the actual policy. You are effectively trading lower policy memory for potential bursts in memory as your cache goes over the limit.
It is important to document the difference between the hooks, and their tradeoffs. I'm not sure how to name the new policies, perhaps we have
Cachex.Policy.LRW.Evented
andCachex.Policy.LRW.Timed
, and we aliasCachex.Policy.LRW
through to the evented version (so we can ship this in a minor version bump).The text was updated successfully, but these errors were encountered: