catbox-redis

Redis adapter for catbox.

Latest Version: 7.0.2
hapi-family
Installation:

npm: npm install @hapi/catbox-redis

yarn: yarn add @hapi/catbox-redis

Module Status:
Version License Node Dependencies CI
7.0.2
hapi helmet github logo
BSD 16, 18, 20 Dependency Status Build Status
6.0.2
hapi helmet github logo
BSD 16, 18, 20 Dependency Status Build Status

Usage

Sample catbox cache initialization:

const Catbox = require('@hapi/catbox');
const { Engine: CatboxRedis } = require('@hapi/catbox-redis');


const cache = new Catbox.Client(CatboxRedis, {
    partition : 'my_cached_data',
    host: 'redis-cluster.domain.com',
    port: 6379,
    db: 0,
    tls: {},
});

When used in a hapi server (hapi version 18 or newer):

const Hapi = require('hapi')
const { Engine: CatboxRedis } = require('@hapi/catbox-redis');

const server = new Hapi.Server({
    cache : [
        {
            name: 'my_cache',
            provider: {
                constructor: CatboxRedis,
                options: {
                    partition : 'my_cached_data',
                    host: 'redis-cluster.domain.com',
                    port: 6379,
                    db: 0,
                    tls: {},
                }
            }
        }
    ]
});