Redis client-side caching wrapper for ioredis using Redis 6+ CLIENT TRACKING BCAST mode. Current stable version is 1.0.7 (last updated October 2023). It automatically invalidates local in-memory cache when subscribed key prefixes change in Redis, reducing latency and server load. Unlike generic caching libraries, this uses native Redis tracking for real-time invalidation without polling. Requires Redis >=6.0 and ioredis >=5.0 as a peer dependency. Ships TypeScript types and supports NOLOOP to avoid self-invalidation.
npm install redis-cscNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows instantiation via async create() method, then getCached and setCached operations.
Replace `new RedisClientSideCache(...)` with `await RedisClientSideCache.create(...)`.
Use individual getCached/setCached in loops until methods are stable.
Ensure Redis 6+ is running. The lib will fail silently or throw an error if tracking is unsupported.
Set both defaultExpiry (Redis key TTL) and localCacheTTL independently to avoid stale data in local cache.
Use prefix-based tracking; for per-key tracking consider alternatives like redis-lru-cache.
Use `const { RedisClientSideCache } = require('redis-csc');` instead of `const RedisClientSideCache = require('redis-csc');`.Upgrade Redis server to 6.0 or later.
Increase readyTimeoutMs or check Redis connection settings.