Can the Caffeine provide a method similar to refresh but only mark the cache value needs to be refresh #681
Replies: 1 comment
-
Currently we don't support variable refresh. The most common case for that was to provide some jitter, which is easily worked around by using the Assuming we had variable refresh where you could set it for an entry, that might be what you want as a refresh will return the current value while it performs the async load. In your proposal the next call wouldn't observe the latest value but only trigger the load. What you might be after is to avoid that refresh will load the value if absent, e.g. a prefetch. The simple solution to that is to check |
Beta Was this translation helpful? Give feedback.
-
Can the Caffeine provide a method similar to refresh but only mark the cache value needs to be refresh.
This way, when one machine recognizes a cache update, it can tell the other machines to mark the cache value to be refresh (rather than invalidate).
if we use invalidate(),next time we invoke get() it will take a long time
Beta Was this translation helpful? Give feedback.
All reactions