Distribucache Redis Store
A Redis datastore for the Distribucache auto-repopulating cache.
Usage
Here's what a simple service using Distribucache with Redis may look like:
;;; // for example const store = ;const cacheClient = distribucache; const cache = cacheClient; { cache; }
API
redisStore(config)
Possible config
values below.
{String} [config.namespace]
{Boolean} [config.isPreconfigured] defaults to false (see note below)
{Object} [config.options] see ioredis options
isPreconfigured
is used to determine whether the store needs to set-up
keyspace notifications, which are used to support the populateIn
feature in a
way that multiple Distribucache clients would not conflict with each other while
automatically populating the cache. Disable this to avoid a warning if you're
running Redis in an environment where CONFIG
is not available.
One such environment is AWS. There you will need to set the notify-keyspace-events
property to Kx
manually through the AWS Management Console.
In addition to the config above, all of the options defined in ioredis are allowed to configure the Redis client.