Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@hverlin/redis-hybrid-cache

hverlin9MIT0.0.3TypeScript support: included

Hybrid Redis client for NodeJS. Leverage the client tracking feature of Redis to combine an in-memory cache with a Redis server for faster performance.

redis, resp3, redis-client, client-side-caching, client tracking

readme

Redis Hybrid Cache

This client makes use of Redis client tracking to combine:

Only works with Redis >= 6 as it makes use of RESP3.

Quick Start

Installation

npm install --save @hverlin/redis-hybrid-cache

See https://github.com/hverlin/redis-hybrid-cache/packages/1570282

Usage

// create the client and set set client side tracking
const client = await createHybridClient();

const value = await client.get('foo'); // null
await client.set('foo', 'bar', { ttl: 60 });

console.log(await client.get('foo')); // bar, from local cache

Supported commands

  • get
  • set
  • del

Other commands are accessible by using client.getRedisClient() which will return a clientV3 instance of hverlin/redis