@fluojs/cache-manager 1.0.0-beta.3 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +3 -1
- package/README.md +3 -1
- package/dist/clone.d.ts +6 -0
- package/dist/clone.d.ts.map +1 -1
- package/dist/clone.js +6 -0
- package/dist/interceptor.js +1 -1
- package/dist/stores/memory-store.d.ts +3 -0
- package/dist/stores/memory-store.d.ts.map +1 -1
- package/dist/stores/memory-store.js +4 -0
- package/package.json +4 -4
package/README.ko.md
CHANGED
|
@@ -125,7 +125,9 @@ Redis reset 소유권은 기본값이 `fluo:cache:`인 `keyPrefix`로 제한됩
|
|
|
125
125
|
|
|
126
126
|
### 쿼리 매개변수 기반 캐싱
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
내장 HTTP 캐시 키 전략은 경로 부분을 route template metadata가 아니라 구체적인 요청 경로(`requestContext.request.path`)에서 계산합니다. 따라서 같은 `@Get('/:id')` 핸들러를 타더라도 `/users/1`과 `/users/2` 같은 요청은 항상 서로 다른 캐시 키로 분리됩니다.
|
|
129
|
+
|
|
130
|
+
기본적으로 캐시 키는 쿼리 매개변수를 무시하고 구체적인 요청 경로만 사용합니다. 검색 조건 등에 따라 다른 응답을 캐싱하려면 `httpKeyStrategy: 'route+query'`를 활성화하세요. 내장 전략에서는 `full`도 동일하게 query-aware 키를 만듭니다.
|
|
129
131
|
|
|
130
132
|
```typescript
|
|
131
133
|
CacheModule.forRoot({
|
package/README.md
CHANGED
|
@@ -125,7 +125,9 @@ Redis reset ownership is scoped by `keyPrefix`, which defaults to `fluo:cache:`.
|
|
|
125
125
|
|
|
126
126
|
### Query-Sensitive Caching
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
Built-in HTTP cache key strategies derive their path segment from the concrete request path (`requestContext.request.path`), not the route template metadata. That means requests such as `/users/1` and `/users/2` always resolve to different cache keys even when they hit the same `@Get('/:id')` handler.
|
|
129
|
+
|
|
130
|
+
By default, the cache key ignores query parameters and uses only the concrete request path. Enable `httpKeyStrategy: 'route+query'` (or `full`, which is equivalent for the built-in strategy set) to cache different responses for different search parameters.
|
|
129
131
|
|
|
130
132
|
```typescript
|
|
131
133
|
CacheModule.forRoot({
|
package/dist/clone.d.ts
CHANGED
package/dist/clone.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../src/clone.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAE9C"}
|
|
1
|
+
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../src/clone.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAE9C"}
|
package/dist/clone.js
CHANGED
package/dist/interceptor.js
CHANGED
|
@@ -54,7 +54,7 @@ function defaultCacheKey(context, strategy, resolver) {
|
|
|
54
54
|
if (typeof strategy === 'function') {
|
|
55
55
|
return strategy(context);
|
|
56
56
|
}
|
|
57
|
-
const path = context.
|
|
57
|
+
const path = context.requestContext.request.path;
|
|
58
58
|
const query = context.requestContext.request.query;
|
|
59
59
|
if (strategy === 'route') {
|
|
60
60
|
return appendPrincipalScope(path, context, resolver);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../../src/stores/memory-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAyC9C,qBAAa,WAAY,YAAW,UAAU;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;IAC/D,OAAO,CAAC,WAAW,CAAK;IAElB,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAsBrD,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBtE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B"}
|
|
1
|
+
{"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../../src/stores/memory-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAyC9C;;GAEG;AACH,qBAAa,WAAY,YAAW,UAAU;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;IAC/D,OAAO,CAAC,WAAW,CAAK;IAElB,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAsBrD,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBtE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B"}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"memory-store",
|
|
11
11
|
"decorator"
|
|
12
12
|
],
|
|
13
|
-
"version": "1.0.0-beta.
|
|
13
|
+
"version": "1.0.0-beta.4",
|
|
14
14
|
"private": false,
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@fluojs/core": "^1.0.0-beta.2",
|
|
41
|
-
"@fluojs/di": "^1.0.0-beta.
|
|
42
|
-
"@fluojs/http": "^1.0.0-beta.
|
|
43
|
-
"@fluojs/runtime": "^1.0.0-beta.
|
|
41
|
+
"@fluojs/di": "^1.0.0-beta.4",
|
|
42
|
+
"@fluojs/http": "^1.0.0-beta.3",
|
|
43
|
+
"@fluojs/runtime": "^1.0.0-beta.4"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"ioredis": "^5.0.0",
|