Hello Team,

This is more of a feature request. While using spring boot starter cache I came across a scenario - I am using caffeine cache implementation from the starter package. When used refreshAfterWrite cache policy, the Application thrown error LoadingCache is needed for refreshAfterWrite .

After reading couple of items on stackoverflow, understood that at present spring boot cache abstraction doesn't support this natively and expects explicit implementation for refreshing logic.

My request: We could use existing @Cacheable annotated method itself as a refresher logic when refreshAfterWrite policy is used.

Comment From: snicoll

@ArpitaSheelavant thanks for the suggestion but LoadingCache is a bit incompatible with the annotation-model that the cache abstraction provides as these are two ways of achieving the same goal. You can use LoadingCache but then you need to programmatically call Cache#get rather than relying on annotations.

There is no one-to-one mapping between an annotated method and the refresh policy that caffeine suggests.