{"id":44735,"library":"distribucache-redis-store","title":"Distribucache Redis Store","description":"A Redis-backed store implementation for Distribucache, an auto-repopulating cache library. Version 6.0.2 is the latest stable release (as of 2024), with infrequent updates. It wraps ioredis for Redis connectivity and supports keyspace notifications for distributed cache population. Differentiates from generic Redis caches by integrating with Distribucache's stale/populate/pause-populate lifecycle.","status":"maintenance","version":"6.0.2","language":"javascript","source_language":"en","source_url":"git://github.com/dowjones/distribucache-redis-store","tags":["javascript","distribucache","cache","redis"],"install":[{"cmd":"npm install distribucache-redis-store","lang":"bash","label":"npm"},{"cmd":"yarn add distribucache-redis-store","lang":"bash","label":"yarn"},{"cmd":"pnpm add distribucache-redis-store","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Redis client for connection and commands","package":"ioredis","optional":false}],"imports":[{"note":"Package is ESM-only since v6; use import, not require.","wrong":"const redisStore = require('distribucache-redis-store')","symbol":"redisStore","correct":"import redisStore from 'distribucache-redis-store'"},{"note":"In CommonJS with ESM wrapper, require returns {default}. Use .default to get the function.","wrong":"const redisStore = require('distribucache-redis-store')","symbol":"redisStore (CommonJS)","correct":"const redisStore = require('distribucache-redis-store').default"},{"note":"Default export is a function; named export 'redisStore' does not exist.","wrong":"import { redisStore } from 'distribucache-redis-store'","symbol":"redisStore (TypeScript)","correct":"import redisStore from 'distribucache-redis-store'"}],"quickstart":{"code":"import distribucache from 'distribucache';\nimport redisStore from 'distribucache-redis-store';\n\nconst store = redisStore({\n  host: 'localhost',\n  port: 6379,\n  namespace: 'myapp',\n  options: {\n    lazyConnect: true\n  }\n});\n\nconst cacheClient = distribucache.createClient(store);\n\nconst cache = cacheClient.create('users', {\n  staleIn: '10 sec',\n  populateIn: '5 sec',\n  pausePopulateIn: '1 min',\n  populate(key, cb) {\n    // fetch from data source\n    cb(null, { id: key, name: 'Alice' });\n  }\n});\n\n// cache.get('123', (err, value) => { ... });","lang":"typescript","description":"Shows how to create a Redis-backed Distribucache store, configure it with ioredis options, and set up an auto-repopulating cache with stale/populate timers."},"warnings":[{"fix":"Use import (or require('pkg').default in CJS).","message":"v6 changed to ESM-only; CommonJS require() no longer works without .default","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Pass config object instead of ioredis instance. ioredis is created internally.","message":"v5 deprecated passing ioredis instance directly; now config is passed as plain object","severity":"deprecated","affected_versions":">=5.0.0 <6.0.0"},{"fix":"Set `isPreconfigured: true` in config and manually set notify-keyspace-events to 'Kx' in AWS console.","message":"AWS Elasticache does not allow CONFIG command; keyspace notifications require manual setup","severity":"gotcha","affected_versions":"all"},{"fix":"Set config.namespace to undefined or omit it if not using populateIn feature.","message":"If not using populateIn, keyspace notifications are unnecessary; omit namespace to avoid warning","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2024':27 '6.0.2':19 'auto':14 'auto-repopul':13 'back':7 'cach':16,43,49,59 'connect':36 'differenti':45 'distribucach':1,11,53,58 'distribut':42 'generic':47 'implement':9 'infrequ':29 'integr':51 'ioredi':33 'javascript':57 'keyspac':39 'latest':22 'librari':17 'lifecycl':56 'notif':40 'popul':44 'redi':2,6,35,48,60 'redis-back':5 'releas':24 'repopul':15 'stabl':23 'stale/populate/pause-populate':55 'store':3,8 'support':38 'updat':30 'version':18 'wrap':32","created_at":"2026-06-07T12:51:34.693391+00:00","updated_at":"2026-06-07T12:51:34.693391+00:00","problems":[{"fix":"Use 'import redisStore from ...' (default import) not 'import { redisStore } from ...'.","cause":"Default import incorrectly expects named export","error":"redisStore is not a function"},{"fix":"Ensure redisStore() is called (not just referenced) and passed to createClient.","cause":"Missing or incorrect store object; redisStore() returns a store object","error":"distribucache.createClient is not a function"},{"fix":"Set config.isPreconfigured: true and manually configure notify-keyspace-events to 'Kx'.","cause":"Redis server (e.g., AWS) disallows CONFIG; store tries to set keyspace notifications","error":"Error: ERR unknown command 'CONFIG'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/dowjones/distribucache-redis-store","github":"git://github.com/dowjones/distribucache-redis-store","docs":null,"changelog":null,"pypi":null,"npm":"distribucache-redis-store","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}