Skip to content

Commit 9115c8c

Browse files
committed
加入jetcache缓存,提高权限判断的性能
1 parent 584c024 commit 9115c8c

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

‎auth/authentication-server/src/main/java/com/springboot/cloud/auth/authentication/service/impl/ResourceService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public ConfigAttribute findConfigAttributesByUrl(HttpServletRequest authRequest)
7373
}
7474

7575
@Override
76-
@Cached(name = "resource4user::", key = "#username", cacheType = CacheType.BOTH)
76+
@Cached(name = "resource4user::", key = "#username", cacheType = CacheType.LOCAL)
7777
public Set<Resource> queryByUsername(String username) {
7878
return resourceProvider.resources(username).getData();
7979
}

‎auth/authentication-server/src/main/resources/application.yml

-14
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,6 @@ jetcache:
4646
keyConvertor: fastjson
4747
expireAfterWriteInMillis: 60000
4848
expireAfterAccessInMillis: 40000
49-
remote:
50-
# 默认2分钟的远程缓存
51-
default:
52-
type: redis
53-
expireAfterWriteInMillis: 120000
54-
keyConvertor: fastjson
55-
valueEncoder: kryo
56-
valueDecoder: kryo
57-
poolConfig:
58-
minIdle: 5
59-
maxIdle: 20
60-
maxTotal: 50
61-
host: ${REDIS_HOST:localhost}
62-
port: ${REDIS_PORT:6379}
6349

6450
logging:
6551
level:

0 commit comments

Comments
 (0)