File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
packages/nextjs-cache-handler/src/handlers Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,24 @@ const redisCacheHandler = createRedisHandler({
158158
159159** Note:** Redis Cluster support is currently experimental and may have limitations or unexpected bugs. Use it with caution.
160160
161+ #### Redis Sentinel
162+
163+ ``` js
164+ import { createSentinel } from " @redis/" ;
165+ import createRedisHandler from " @fortedigital/nextjs-cache-handler/redis-strings" ;
166+
167+ const redisHandler = await createRedisHandler ({
168+ client: createSentinel ({
169+ url: process .env .REDIS_URL ,
170+ }),
171+ keyPrefix: " myApp:" ,
172+ sharedTagsKey: " myTags" ,
173+ sharedTagsTtlKey: " myTagTtls" ,
174+ });
175+ ```
176+
177+ ** Note:** Redis Sentinel support is currently experimental and may have limitations or unexpected bugs. Use it with caution.
178+
161179---
162180
163181### ` local-lru `
Original file line number Diff line number Diff line change 66 convertStringsToBuffers ,
77 parseBuffersToStrings ,
88} from "../helpers/buffer" ;
9- import type { RedisClientType } from "@redis/client" ;
9+ import type { RedisClientType , RedisSentinelType } from "@redis/client" ;
1010import { RedisClusterCacheAdapter } from "../helpers/redisClusterAdapter" ;
1111import { withAbortSignalProxy } from "../helpers/withAbortSignalProxy" ;
1212
@@ -34,7 +34,7 @@ export default function createHandler({
3434 keyExpirationStrategy = "EXPIREAT" ,
3535 revalidateTagQuerySize = 10_000 ,
3636} : CreateRedisStringsHandlerOptions <
37- RedisClientType | RedisClusterCacheAdapter
37+ RedisClientType | RedisClusterCacheAdapter | RedisSentinelType
3838> ) : Handler {
3939 const client = withAbortSignalProxy ( innerClient ) ;
4040 const revalidatedTagsKey = keyPrefix + REVALIDATED_TAGS_KEY ;
Original file line number Diff line number Diff line change 1- import type { RedisClientType } from "@redis/client" ;
1+ import type { RedisClientType , RedisSentinelType } from "@redis/client" ;
22import { RedisClusterCacheAdapter } from "../helpers/redisClusterAdapter" ;
33
44export type RedisCompliantCachedRouteValue = {
@@ -15,7 +15,7 @@ export type RedisCompliantCachedAppPageValue = {
1515} ;
1616
1717export type CreateRedisStringsHandlerOptions <
18- T = RedisClientType | RedisClusterCacheAdapter ,
18+ T = RedisClientType | RedisClusterCacheAdapter | RedisSentinelType ,
1919> = {
2020 /**
2121 * The Redis client instance.
You can’t perform that action at this time.
0 commit comments