导入cache依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>




启动商品服务访问

第一次访问,存入缓存

第二次访问,就不会访问方法查询数据库,直接从缓存中查询
导入cache依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>




启动商品服务访问

第一次访问,存入缓存

第二次访问,就不会访问方法查询数据库,直接从缓存中查询

被折叠的 条评论
为什么被折叠?