spring配置redis注解缓存

大致步骤如下:

    0.spring的主配置中声明注解缓存:<cache:annotation-driven cache-manager="redisCacheManager"/>

      1.maven的pom.xml文件导入架包

   2.配置文件添加配置

   3.spring管理bean的生成,xml文件配置

   4. RedisCacheConfig redis自定义的工具类,自定义redis的key生成规则

   5.在你想要做缓存的地方,使用注解进行缓存

参考文章 :  https://www.cnblogs.com/qlqwjy/p/8574121.html

猜你喜欢

转载自www.cnblogs.com/jiftle/p/11084124.html