feat(user): 引入本地缓存优化用户信息查询性能
- 添加 Caffeine 依赖并配置本地缓存 - 实现用户信息多级缓存:本地缓存 -> Redis -> 数据库 - 新增用户信息缓存KEY常量及构建方法 - 配置自定义线程池用于异步缓存操作 - 实现缓存空对象防止击穿与过期时间随机化 - 添加 JsonUtils 工具类解析 JSON 字符串为对象的方法
This commit is contained in:
@@ -88,6 +88,11 @@
|
||||
<groupId>com.hanserwei</groupId>
|
||||
<artifactId>han-note-distributed-id-generator-api</artifactId>
|
||||
</dependency>
|
||||
<!-- Caffeine 本地缓存 -->
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user