Skip to main content

Configuration Introduction

The Redis plugin for Strapi is a simple wrapper around the ioredis package but also includes the redlock package for distributed locks. This plugin provides a simple and easy-to-use interface for connecting to a Redis (or Redis alternative) database.

Complete Configuration

This configuration table does not include all possible options as many of them come from ioredis directly and what is shown here is mostly those options related to the plugin specifically and showing the default values.

KeyDescriptionTypeDefault
settingsThe settings for the Redis plugin.ObjectN/A
settings.debugWhether to enable debug mode.Booleanfalse
settings.debugIORedisWhether to enable debug mode for ioredis.Booleanfalse
settings.enableRedlockWhether to enable redlock for distributed locks.Booleanfalse
settings.lockDelayThe delay in milliseconds for the lock.Numbernull
settings.lockTTLThe time-to-live in milliseconds for the lock.Number5000
settings.redlockConfigThe redlock configuration.ObjectN/A
settings.redlockConfig.driftFactorThe drift factor for redlock.Number0.01
settings.redlockConfig.retryCountThe retry count for redlock.Number10
settings.redlockConfig.retryDelayThe retry delay for redlock.Number200
settings.redlockConfig.retryJitterThe retry jitter for redlock.Number200
connectionsThe connections for the Redis plugin.ObjectN/A
connections.defaultThe default connection for the Redis plugin.ObjectN/A
connections.default.connectionThe object passed to ioredis directlyObjectN/A
connections.default.connection.hostThe host for the connection.String127.0.0.1
connections.default.connection.portThe port for the connection.Number6379
connections.default.connection.passwordThe password for the connection.Stringnull
connections.default.connection.dbThe database for the connection.Number0
connections.default.settingsThe settings for the connection.ObjectN/A
connections.default.settings.debugWhether to enable debug mode for this connection.Booleanfalse