{"id":"0921fca62d0af0f1","repo":"redis/node-redis","slug":"client-side-caching-is-only-supported-with-resp3-0921fc","errorCode":null,"errorMessage":"Client Side Caching is only supported with RESP3","messagePattern":"Client Side Caching is only supported with RESP3","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/client/lib/cluster/cluster-slots.ts","lineNumber":203,"sourceCode":"  readonly scanCursors = new Map<string, ScanCursorEntry>();\n  #cursorTokenSeq = 0;\n  #topologyRefreshPromise?: Promise<boolean | void>;\n\n  #isOpen = false;\n\n  get isOpen() {\n    return this.#isOpen;\n  }\n\n  #isReady = false;\n\n  get isReady() {\n    return this.#isReady;\n  }\n\n  #validateOptions(options?: RedisClusterOptions<M, F, S, RESP, TYPE_MAPPING>) {\n    if (options?.clientSideCache && (options?.RESP ?? DEFAULT_RESP) !== 3) {\n      throw new Error('Client Side Caching is only supported with RESP3');\n    }\n  }\n\n  constructor(\n    options: RedisClusterOptions<M, F, S, RESP, TYPE_MAPPING>,\n    emit: EventEmitter['emit'],\n    clusterClientId: string\n  ) {\n    this.#validateOptions(options);\n    this.#options = options;\n    this.#himportRegistry = options.himportRegistry ?? new FieldsetRegistry();\n    this.#clusterClientId = clusterClientId;\n    this.#reconnectionTracker = new ClusterReconnectionTracker(options.topologyRefreshOnReconnectionAttemptStrategy);\n\n    if (options?.clientSideCache) {\n      if (options.clientSideCache instanceof PooledClientSideCacheProvider) {\n        this.clientSideCache = options.clientSideCache;\n      } else {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/redis/node-redis/blob/bb5beb56578573910e2ee8f39681edc214c41398/packages/client/lib/cluster/cluster-slots.ts#L185-L221","documentation":"Thrown from RedisClusterSlots.#validateOptions (cluster-slots.ts:203) at cluster construction. Client Side Caching (the clientSideCache option) requires RESP3 because server-to-client invalidation push messages are a RESP3 feature; enabling it while explicitly setting RESP: 2 is rejected. Omitting RESP defaults to 3 and is allowed.","triggerScenarios":"createCluster({ clientSideCache: {...}, RESP: 2 }) — explicitly opting into RESP2 together with client-side caching.","commonSituations":"Copying a RESP2 standalone-client config into a cluster; mixing legacy RESP2 settings with the newer CSC option; explicit RESP:2 for compatibility with an older Redis.","solutions":["Remove the explicit RESP: 2 so the cluster defaults to RESP3.","Or explicitly set RESP: 3 when enabling clientSideCache.","Upgrade Redis to >= 6.0 with RESP3 support (>= 7.0 recommended) before using client-side caching."],"exampleFix":"// before\nconst cluster = createCluster({\n  rootNodes,\n  RESP: 2 as const,\n  clientSideCache: { ttl: 0, maxEntries: 100 }\n}); // throws\n\n// after\nconst cluster = createCluster({\n  rootNodes,\n  RESP: 3 as const,\n  clientSideCache: { ttl: 0, maxEntries: 100 }\n});","handlingStrategy":"validation","validationCode":"const opts = { clientSideCache: { ttl: 0, maxEntries: 100 } };\nif (opts.clientSideCache && (explicitResp ?? 3) !== 3) {\n  throw new Error('drop RESP:2 or clientSideCache');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not set RESP:2 when enabling clientSideCache.","Run Redis >= 6.0 (prefer 7.0+) for RESP3 CSC invalidation.","Omit RESP entirely to accept the RESP3 default."],"tags":["cluster","client-side-caching","resp3","configuration"],"analyzedSha":"bb5beb56578573910e2ee8f39681edc214c41398","analyzedAt":"2026-08-03T19:09:15.686Z","schemaVersion":2}