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({
125125});
126126```
127127
128- #### Redis Cluster
128+ #### Redis Cluster (Experimental)
129129
130130``` js
131131import { createCluster } from " @redis/client" ;
@@ -156,6 +156,8 @@ const redisCacheHandler = createRedisHandler({
156156});
157157```
158158
159+ ** Note:** Redis Cluster support is currently experimental and may have limitations or unexpected bugs. Use it with caution.
160+
159161---
160162
161163### ` local-lru `
Original file line number Diff line number Diff line change 1818 " next" ,
1919 " redis"
2020 ],
21- "version" : " 2.1.0-canary10 " ,
21+ "version" : " 2.1.0-canary11 " ,
2222 "type" : " module" ,
2323 "license" : " MIT" ,
2424 "description" : " Next.js cache handlers" ,
104104 "rimraf" : " 6.0.1" ,
105105 "ts-jest" : " ^29.4.1" ,
106106 "tsup" : " ^8.5.0" ,
107- "tsx" : " 4.20.3 " ,
107+ "tsx" : " 4.20.4 " ,
108108 "typescript" : " ^5.9.2" ,
109- "typescript-eslint" : " ^8.39.1 "
109+ "typescript-eslint" : " ^8.40.0 "
110110 },
111111 "peerDependencies" : {
112112 "@redis/client" : " >= 5.5.6" ,
116116 " next15"
117117 ],
118118 "optionalDependencies" : {
119- "@rollup/rollup-linux-x64-gnu" : " ^4.46.2 "
119+ "@rollup/rollup-linux-x64-gnu" : " ^4.46.4 "
120120 },
121121 "engines" : {
122122 "node" : " >=22.0.0"
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export default function createHandler({
3737 RedisClientType | RedisClusterCacheAdapter
3838> ) : Handler {
3939 const client = withAbortSignalProxy ( innerClient ) ;
40+ const revalidatedTagsKey = keyPrefix + REVALIDATED_TAGS_KEY ;
4041
4142 function assertClientIsReady ( ) : void {
4243 if ( ! client . isReady ) {
@@ -162,8 +163,6 @@ export default function createHandler({
162163 ] ) ;
163164 }
164165
165- const revalidatedTagsKey = keyPrefix + REVALIDATED_TAGS_KEY ;
166-
167166 return {
168167 name : "redis-strings" ,
169168 async get ( key , { implicitTags } ) {
Original file line number Diff line number Diff line change 11import type { RedisClientType } from "@redis/client" ;
2+ import { RedisClusterCacheAdapter } from "../helpers/redisClusterAdapter" ;
23
34export type RedisCompliantCachedRouteValue = {
45 // 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 = {
1314 segmentData : Record < string , string > | undefined ;
1415} ;
1516
16- export type CreateRedisStringsHandlerOptions < T = RedisClientType > = {
17+ export type CreateRedisStringsHandlerOptions <
18+ T = RedisClientType | RedisClusterCacheAdapter ,
19+ > = {
1720 /**
1821 * The Redis client instance.
1922 */
You can’t perform that action at this time.
0 commit comments