spring boot EnableCaching 缓存

Spring Boot 添加缓存

  1. 在pom.xml引入catch依赖
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
  1. 在springboot主体类中添加@EnableCaching注解。
    @EnableCaching:注解是spring framework中的注解驱动的缓存管理功能。
  2. 在数据访问接口中,增加缓存配置注解。
    缓存注解:@Cacheable 、 @CachePut 、@CacheEvict

猜你喜欢

转载自blog.csdn.net/qq_36567996/article/details/87936409