spring-framework / org.springframework.cache.caffeine

Package org.springframework.cache.caffeine

Types

CaffeineCache

open class CaffeineCache : AbstractValueAdaptingCache

Spring org.springframework.cache.Cache adapter implementation on top of a Caffeine com.github.benmanes.caffeine.cache.Cache instance.

Requires Caffeine 2.1 or higher.

CaffeineCacheManager

open class CaffeineCacheManager : CacheManager

CacheManager implementation that lazily builds CaffeineCache instances for each #getCache request. Also supports a 'static' mode where the set of cache names is pre-defined through #setCacheNames, with no dynamic creation of further cache regions at runtime.

The configuration of the underlying cache can be fine-tuned through a Caffeine builder or CaffeineSpec, passed into this CacheManager through #setCaffeine/#setCaffeineSpec. A CaffeineSpec-compliant expression value can also be applied via the "cacheSpecification" bean property.

Requires Caffeine 2.1 or higher.