SpringJCache条件缓存
spring的JCache注释SpringJCache条件缓存,spring,spring-boot,spring-cache,jcache,Spring,Spring Boot,Spring Cache,Jcache,spring的JCache注释@CacheResult是否允许像spring自己的注释一样进行条件缓存?e、 g @Cacheable(cacheNames="book", condition="#name.length < 32", unless="#result.hardback") @Cacheable(cacheNames=“book”,condition=“#name.length
@CacheResult
是否允许像spring自己的注释一样进行条件缓存?e、 g
@Cacheable(cacheNames="book", condition="#name.length < 32", unless="#result.hardback")
@Cacheable(cacheNames=“book”,condition=“#name.length<32”,除非=“#result.hardback”)
我在文档或源代码中找不到任何内容。首先,没有“Spring的JCache注释”。不,标准的javax.cache.CacheResult
注释不支持条件缓存
基本上,您应该根据要使用的功能选择要使用的注释类型。如果愿意,您可以在同一个项目中“使用”这两个选项,但我们强烈建议不要在同一个缓存中混合/匹配它们