load vs loadAll when using refreshAfterWrite #1891
-
Let's start with an example: I am calling
I think it's clear that caffeine will call my |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yeah, bulk refresh is very confusing (#7). What you probably want is to look at the coalescing bulkloader example. Caffeine doesn't directly offer any bulk refresh logic so it will otherwise perform 10 load() calls. A A refresh calls the |
Beta Was this translation helpful? Give feedback.
Yeah, bulk refresh is very confusing (#7). What you probably want is to look at the coalescing bulkloader example. Caffeine doesn't directly offer any bulk refresh logic so it will otherwise perform 10 load() calls.
A
getAll
that has the opportunity to bulk refresh is likely much rarer than parallelget
calls for distinct keys, but wouldn't naturally fall into a case where the cache could callloadAll
instead. The coalescing approach over a time/space window handles bothgetAll
andget
cases uniformly, and if using a library like Reactor then its trivial glue code. This is nice because refreshes are optimistic, async loads so a small buffering delay won't impact user-facing latencies and …