A Node.js MySQL caching framework backed by Redis. Version 0.0.8 automatically caches SQL query results in Redis (database 0) with configurable TTL and lazy expiration. On data mutations, it invalidates cached tables. Requires mysql and redis packages as peer dependencies. Suitable for read-heavy workloads, but has limited documentation and appears in early development stages. Unlike more mature solutions (e.g., catbox), it provides an automatic but opaque caching strategy keyed by SQL strings.
npm install mysql-cache-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures MySQL pool and Redis client, binds to mysql-cache-redis, and executes a cached query.
Always use parameterized queries; avoid dynamic SQL concatenation.
Install @types/mysql-cache-redis if available, or declare module manually.
Ensure Redis DB 0 is unused by other applications, or fork and modify source.
Use TRIGGERs or application-level cache-busting upon write operations.
Consider alternatives like catbox or redis-mock-cache.
Change import statement to const mcr = require('mysql-cache-redis');Ensure bind() is called exactly once before any connect() calls.
Start Redis server and verify redisConfig host/port values.