More of a question than a feature request: is a LoadingCache in scope for Ristretto? The Java cache library caffeine has a good description: Population · ben-manes/caffeine Wiki · GitHub
The use-case is when I want to load cache values dynamically and asynchronously. As a specific example, I want to put Ristretto in front of loading blobs out of S3. The problem is if I receive 1000 requests for the same blob in a short span of time (before the first request sets the blob value in Ristretto), I’ll forward each of the 1000 requests to S3 and then each request will also set
the value for the key.
With a loading cache, the first request cache typically sets a promise for the value (in Java at least) that all subsequent get
calls use instead of fetching from S3, so there’s only 1 call to S3 instead of 1000.
Is a LoadingCache within Ristretto’s scope or is this better suited to a layer on top of Ristretto? I think there’s value in adding a LoadingCache to Ristretto since the semantics aren’t the easiest thing to get right.