-
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如下。
-
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
spring redis缓存原理
最新推荐文章于 2023-07-23 15:42:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)