Bentocache is a robust, multi-tier caching solution for Node.js, currently at version 1.6.1. It offers a rich set of features including multi-tier caching (local+distributed), bus-based L1 synchronization, cache stampede protection, graceful degradation with stale data, SWR-like strategies, namespaces, and tagging. Compared to simpler libraries like keyv, cache-manager, or unstorage, Bentocache is a full-featured caching solution designed for production-grade applications. It supports multiple drivers (Redis, Upstash, Cloudflare KV, File, In-memory, DynamoDB, Postgres, Sqlite) and ships with TypeScript types. The project follows a regular release cadence with active development.
npm install bentocacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows single-level Redis and multi-tier (Memory+Redis) cache instantiation, set/get operations.
Use import syntax. If using CommonJS, consider dynamic import (import('bentocache')).Update imports to use bentocache/drivers/redis etc.
Install ioredis: npm install ioredis
Use string format for clarity: ttl: '1h' instead of ttl: 3600.
Update import to 'bentocache/drivers/redis' (without /dist/).
Use import { Bentocache } from 'bentocache' instead of require.Ensure Redis is running on localhost:6379 or configure the connection properly.
Check that the driver is imported and registered under the correct name in stores config.