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

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


版权声明:本文为abckingaa原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。