spring caching 和RedissonSpringCacheManager

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 17:50   2037   0

RedissonSpringCacheManager

  • @Cacheable: Triggers cache population. 增
    对应RedissonSpringCacheManager中添加方法
  • @CacheEvict: Triggers cache eviction. 删
    对应RedissonSpringCacheManager中删除方法
  • @CachePut: Updates the cache without interfering with the method execution. 改
    对应RedissonSpringCacheManager中修改方法

caller 调用 computePiDecimal 方法, cacheManager找到缓存服务器,并调用缓存服务器适配 spring caching 机制的所提供的适配方法, 保存缓存数据。
需要提供key,不然key由simpleKeyGenerator生成一个随机的key

在调用computePiDecimal前,先查找当前有没有piDecimals缓存并且匹配i参数
如果找到缓存且匹配了i参数,则不用执行computePiDecimal方法,且直接返回缓存数据。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP