Cache and invalidate records in Redis by tags. Version 1.2.1 is the latest stable release (last updated ~2018). Provides a simple API to store key-value pairs with associated tags, and invalidate all records matching one or more tags. Uses ioredis internally and supports custom timeouts per record. Differentiator: tag-based invalidation pattern for efficient cache busting without key enumeration.
npm install redis-tag-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: create cache instance, set a key with tags, get it, invalidate by tag, and confirm invalidation.
Let the library manage prefixes; do not manually set keys starting with 'data:' or 'tags:'.
Always use valid JSON-serializable values. Use delete or set to expire instead of storing null.
Design application logic to treat null as 'not found' or 'expired' directly.
Consider using @types/redis-tag-cache if it exists, or migrate to a more modern alternative like ioredis-based caching with tags.
Use `import TagCache from 'redis-tag-cache'` instead of `import { TagCache } from 'redis-tag-cache'`.Install ioredis: `npm install ioredis` or `yarn add ioredis`.
Ensure you use `new TagCache()` and import default export.