spring的缓存抽象
详情参看:《SpringBoot基础系列-SpringCache使用》
支持
ConcurrentMap、EhCache、Caffeine、JCache
接口
org.springframework.cache.Cache
org.springframework.cache.CacheManager
基于注解的缓存
@EnableCaching 开启缓存注解
- @Cacheable 定义缓存,用于触发缓存
- @CacheEvict 定义清除缓存,触发缓存清除
- @CachePut 定义更新缓存,触发缓存更新
- @Caching 组合定义多种缓存功能
- @CacheConfig 定义公共设置,位于class之上,如缓存名字