mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
[重大更新] 新增 PlusCacheWrapper装饰器 为SpringCache增加本地缓存减少redis查询提高性能(尝试性更新问题未知 请勿轻易更新尝试)
This commit is contained in:
@ -15,6 +15,8 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Sa-Token持久层接口(使用框架自带RedisUtils实现 协议统一)
|
||||
* <p>
|
||||
* 采用 caffeine + redis 多级缓存 优化并发查询效率
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@ -22,7 +24,7 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
|
||||
private static final Cache<String, Object> CAFFEINE = Caffeine.newBuilder()
|
||||
// 设置最后一次写入或访问后经过固定时间过期
|
||||
.expireAfterWrite(10, TimeUnit.SECONDS)
|
||||
.expireAfterWrite(5, TimeUnit.SECONDS)
|
||||
// 初始的缓存空间大小
|
||||
.initialCapacity(100)
|
||||
// 缓存的最大条数
|
||||
|
Reference in New Issue
Block a user