File tree Expand file tree Collapse file tree 5 files changed +85
-80
lines changed
packages/nextjs-cache-handler Expand file tree Collapse file tree 5 files changed +85
-80
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ const redisHandler = await createRedisHandler({
125
125
});
126
126
```
127
127
128
- #### Redis Cluster
128
+ #### Redis Cluster (Experimental)
129
129
130
130
``` js
131
131
import { createCluster } from " @redis/client" ;
@@ -156,6 +156,8 @@ const redisCacheHandler = createRedisHandler({
156
156
});
157
157
```
158
158
159
+ ** Note:** Redis Cluster support is currently experimental and may have limitations or unexpected bugs. Use it with caution.
160
+
159
161
---
160
162
161
163
### ` local-lru `
Original file line number Diff line number Diff line change 18
18
" next" ,
19
19
" redis"
20
20
],
21
- "version" : " 2.1.0-canary10 " ,
21
+ "version" : " 2.1.0-canary11 " ,
22
22
"type" : " module" ,
23
23
"license" : " MIT" ,
24
24
"description" : " Next.js cache handlers" ,
104
104
"rimraf" : " 6.0.1" ,
105
105
"ts-jest" : " ^29.4.1" ,
106
106
"tsup" : " ^8.5.0" ,
107
- "tsx" : " 4.20.3 " ,
107
+ "tsx" : " 4.20.4 " ,
108
108
"typescript" : " ^5.9.2" ,
109
- "typescript-eslint" : " ^8.39.1 "
109
+ "typescript-eslint" : " ^8.40.0 "
110
110
},
111
111
"peerDependencies" : {
112
112
"@redis/client" : " >= 5.5.6" ,
116
116
" next15"
117
117
],
118
118
"optionalDependencies" : {
119
- "@rollup/rollup-linux-x64-gnu" : " ^4.46.2 "
119
+ "@rollup/rollup-linux-x64-gnu" : " ^4.46.4 "
120
120
},
121
121
"engines" : {
122
122
"node" : " >=22.0.0"
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export default function createHandler({
37
37
RedisClientType | RedisClusterCacheAdapter
38
38
> ) : Handler {
39
39
const client = withAbortSignalProxy ( innerClient ) ;
40
+ const revalidatedTagsKey = keyPrefix + REVALIDATED_TAGS_KEY ;
40
41
41
42
function assertClientIsReady ( ) : void {
42
43
if ( ! client . isReady ) {
@@ -162,8 +163,6 @@ export default function createHandler({
162
163
] ) ;
163
164
}
164
165
165
- const revalidatedTagsKey = keyPrefix + REVALIDATED_TAGS_KEY ;
166
-
167
166
return {
168
167
name : "redis-strings" ,
169
168
async get ( key , { implicitTags } ) {
Original file line number Diff line number Diff line change 1
1
import type { RedisClientType } from "@redis/client" ;
2
+ import { RedisClusterCacheAdapter } from "../helpers/redisClusterAdapter" ;
2
3
3
4
export type RedisCompliantCachedRouteValue = {
4
5
// See: https://github.com/vercel/next.js/blob/f5444a16ec2ef7b82d30048890b613aa3865c1f1/packages/next/src/server/response-cache/types.ts#L97
@@ -13,7 +14,9 @@ export type RedisCompliantCachedAppPageValue = {
13
14
segmentData : Record < string , string > | undefined ;
14
15
} ;
15
16
16
- export type CreateRedisStringsHandlerOptions < T = RedisClientType > = {
17
+ export type CreateRedisStringsHandlerOptions <
18
+ T = RedisClientType | RedisClusterCacheAdapter ,
19
+ > = {
17
20
/**
18
21
* The Redis client instance.
19
22
*/
You can’t perform that action at this time.
0 commit comments