(三十五)Bee V1.11使用Redis二级缓存配置

165 篇文章 2 订阅
120 篇文章 1 订阅

Bee V1.11使用Redis二级缓存配置

首先要声明是使用二级缓存,  因为默认二级缓存是关闭的.

bee.osql.cache.useLevelTwo=true

然后是配置,一级缓存,是否还放入二级缓存

#永久和长久缓存默认不放二级缓存,其它一级缓存可通过该配置设置
bee.osql.cache.levelOneTolevelTwo=false

再配置二级缓存的时间.

#二级缓存默认保存时间(秒 second)
bee.osql.cache.levelTwoTimeout=12

剩下的就是bee.osql.cacheRedis.开头的关于redis的配置.

配置好后,要使用redis缓存,还需要启动redis服务

完整配置如下:

#since V1.11
#prototype: 0 not prototype, but faster; 1:prototype,if have NotSerializableException, do not put in cache, slower, but safer; 2 : prototype, but have NotSerializableException,return original  
#high safe cache,the javabean(entity) need implements Serializable interface.
bee.osql.cache.prototype=1
bee.osql.cache.useLevelTwo=true
#永久和长久缓存默认不放二级缓存,其它一级缓存可通过该配置设置
bee.osql.cache.levelOneTolevelTwo=false
#二级缓存默认保存时间(秒 second)
bee.osql.cache.levelTwoTimeout=12


bee.osql.cacheRedis.host=localhost
bee.osql.cacheRedis.port=
bee.osql.cacheRedis.password=123456
#,  second
bee.osql.cacheRedis.connectionTimeout=10
#Read timed out,  second
bee.osql.cacheRedis.soTimeout=3
#bee.osql.cacheRedis.database=
#bee.osql.cacheRedis.clientName=
#bee.osql.cacheRedis.ssl=
#cache=======================end

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值