Expert rules for caching, key management, and performance in Redis. Use when implementing Redis caching strategies, managing key namespaces, or optimizing Redis performance. (triggers: **/*.ts, **/*.js, **/redis.config.ts, redis, cache, ttl, eviction)
ACL SETUSER) to restrict commands by user/role.FLUSHALL, KEYS, CONFIG, and SHUTDOWN in production.read_timeout and connect_retries to handle transient network saturation.app:user:123, rate:limit:ip:1.1.1.1).SCAN instead of KEYS. Use UNLINK instead of DEL for background reclamation of large keys.EVALSHA for atomic logic; ensure scripts are pre-loaded to save bandwidth.ZRANGE, HGETALL, and LRANGE results with offsets/limits.allkeys-lru for general caches and volatile-lru for mixed persistent/ephemeral data.lazyfree-lazy-eviction and lazyfree-lazy-expire (Redis 4.0+) to offload cleanup from the main thread.Used Memory RSS vs Used Memory Dataset. Large fragmentation suggests a need for MEMORY PURGE or scaling.HSET for object fields to enable O(1) access without full decode.