shiro整合springboot-03-缓存

使用CacheManager

1 Cache 作用

  • Cache 缓存: 计算机内存中一段数据
  • 作用: 用来减轻DB的访问压力,从而提高系统的查询效率
  • 流程:

 

 

2 .使用shiro中默认EhCache实现缓存

(1).引入依赖

<!--引入shiro和ehcache-->
<dependency>
  <groupId>org.apache.shiro</groupId>
  <artifactId>shiro-ehcache</artifactId>
  <version>1.5.3</version>
</dependency>

(2).开启缓存

 

posted @ 2021-02-22 23:48  不爱水的派大星  阅读(43)  评论(0)    收藏  举报