New to Caffeine and I'm clearly missing something super fundamental. All the basic usage examples I see look like this:
LoadingCache<String,Fizzbuzz> fizzbuzzes = Caffeine.newBuilder()
.maximumSize(100)
.expireAfterWrite(10, TimeUnit.DAYS)
.build(k -> fetchFizzbuzzes());
What I'm struggling with is the role that the fetchFizzbuzzes() function plays:
- Is it used to populate the initial cache?
- Is it used as some sort of fallback in case a key doesn't exist in the cache?
- Something else?