Registry / database / loopback-redis-cache

loopback-redis-cache

JSON →
library1.0.10jsnpmunverified

Redis cache mixin for LoopBack.io (v1.0.10, last released 2017). Caches GET requests and invalidates on create/update/delete. Supports per-model Redis server config with fallback. Requires Node.js v4+. Note: This package is unmaintained, uses deprecated dependencies (node_redis, redis-delete-pattern), and may not work with LoopBack 4. Alternatives: loopback-connector-kv-redis or custom caching.

npm install loopback-redis-cache
INSTALL
IMPORT
SIG · LOOPBACK-REDIS-CAC
L
loopback-redis-cache
databasejavascriptv1.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Rediscache
// No import needed; use via model mixin config "mixins": { "Rediscache": {} }
const Rediscache = require('loopback-redis-cache');
This is a LoopBack mixin; it is not imported directly but configured in model JSON.

Configure Rediscache mixin on a LoopBack model with optional Redis host/password via environment variables.

// In your model JSON (e.g., common/models/game.json) { "name": "Game", "base": "PersistedModel", "mixins": { "Rediscache": { "client": { "host": process.env.REDIS_HOST || '127.0.0.1', "password": process.env.REDIS_PASSWORD || '' } } }, "properties": {} }
Debug
Known issues
deprecatedPackage is unmaintained since 2017. Use at your own risk.
fix
Migrate to loopback-connector-kv-redis or implement custom caching.
affects: *
breakingRequires deprecated 'redis' and 'redis-delete-pattern' packages which may have known security vulnerabilities.
fix
Pin redis version to 2.x (may require npm overrides) or switch to different cache solution.
affects: >=1.0.0 <2.0.0
gotchaCache invalidation only works on standard LoopBack create/update/delete operations. Direct Redis operations bypass invalidation.
fix
Always use LoopBack model methods to ensure cache is cleared.
affects: *
gotchaNo support for LoopBack 4. This package is designed for LoopBack 2/3 only.
fix
Use loopback-connector-kv-redis for LoopBack 4.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'redis-delete-pattern'
Missing dependency 'redis-delete-pattern' which is not included in npm install (package bug).
fix
Manually install: npm install redis-delete-pattern --save
TypeError: Rediscache is not a mixin
Mixin not loaded because model-config.json path is incorrect.
fix
Ensure 'mixins' entry points to '../../node_modules/loopback-redis-cache' from your model-config.json.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies
loopbackrequiredPeer dependency - requires LoopBack application context
redisrequiredRedis client for caching operations
Agent activity
9 hits · last 30 days
node
6
Resources
loopback-redis-cache — npm install loopback-redis-cache · libregistry