springboot整合cache缓存
第一步:在 pom.xml 文件中导入对应坐标
<!--cache-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
第二步:启用缓存 在启动类是加上 @EnableCaching 注解以 开启缓存功能

第三步:在对应的实现类上 设置当前操作的结果进入缓存

完成!!

浙公网安备 33010602011771号