akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/docs/akka-http
Other
1.34k stars 594 forks source link

Allow a custom caffeine cache loader #4120

Open Marcus-Rosti opened 2 years ago

Marcus-Rosti commented 2 years ago

I'd love to be able to plugin a specific caffeine implementation rather than just the default. For instance with an oauth token that requires being "refreshed" via an http request. I'd love to be able to use https://github.com/ben-manes/caffeine/wiki/Refresh to do it

jrudolph commented 2 years ago

I think that would be useful. Could it be as simple as a function which creates an akka-http Cache[T] from an arbitrary caffeine AsyncCache[T]?