-
spring cache启动开关 EnabelCaching
-
@EnableAsync @SpringBootApplication(scanbasePackages = {"com.lls.asset.service"}, exclude = { DataSourceAutoConfiguration.class, MybatisPlusConfig.class }) @NacosPropertySources({ @NacosPropertySource(dataId = "ast-service", autoRefreshed = true, type = ConfigType.YAML) }) @EnableAspectJAutoProxy(exposeProxy = true) @ public class AstServiceRunApplication { public static void main(String[] args) { SpringApplication.run(AstServiceRunApplication.class, args); } } -
CacheManager spi,缓存管理器,提供了访问缓存名称和缓存对象的方法。spring 本身提供了simpleCacheManager 、compositeCacheManager等管理器的实现。我们项目用的是redisCacheManager,需要配置maven如下。
-
org.springframework.boot spring-boot-starter-data-redis



