Registry / database / strapi-provider-rest-cache-redis

strapi-provider-rest-cache-redis

JSON →
library4.2.9jsnpmunverified

A Redis-based caching provider for the strapi-plugin-rest-cache plugin, enabling efficient HTTP response caching in Strapi v4 applications. Current version 4.2.9 integrates with Strapi 4.x and strapi-plugin-rest-cache ^4.0.0. It uses ioredis to connect to Redis and supports configurable TTL, cache invalidation strategies, and multi-instance Redis setups. Unlike memory-based caches, this provider allows cache persistence and sharing across Strapi instances. Community-maintained, with monthly releases following strapi-plugin-rest-cache updates.

npm install strapi-provider-rest-cache-redis
INSTALL
IMPORT
SIG · STRAPI-PROVIDER-RE
S
strapi-provider-rest-cache-redis
databasejavascriptv4.2.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

redisProvider
import redisProvider from 'strapi-provider-rest-cache-redis'
const redisProvider = require('strapi-provider-rest-cache-redis')
Default export, ESM only since Strapi 4 uses ESM.
config
export default ({ env }) => ({ 'rest-cache': { provider: redisProvider, providerOptions: { connection: { connectionString: env('REDIS_URL') } } } })
module.exports = ({ env }) => ({ ... })
Configure in config/plugins.js or config/plugins.ts as an ESM export.
RedisProviderOptions
import type { RedisProviderOptions } from 'strapi-provider-rest-cache-redis'
TypeScript type for provider options, available since v4.2.0.

Configures the Redis cache provider for Strapi's rest-cache plugin with a default Redis URL and max cache size.

// config/plugins.js import redisProvider from 'strapi-provider-rest-cache-redis'; export default ({ env }) => ({ 'rest-cache': { config: { provider: redisProvider, providerOptions: { connection: { connectionString: env('REDIS_URL') ?? 'redis://localhost:6379', enableAutoPipelining: true }, max: 500 } } } });
Debug
Known issues
deprecatedProvider options 'connectionString' is deprecated in favor of 'connection.connectionString' since v4.2.0.
fix
Use connection: { connectionString: '...' } instead of top-level connectionString.
affects: >=4.2.0
gotchaMust have strapi-plugin-rest-cache installed and enabled, otherwise cache won't work.
fix
Install strapi-plugin-rest-cache via npm and add it to the plugins config.
affects: *
brokenStrapi v3 is not supported; package works only with Strapi v4.
fix
Upgrade to Strapi v4 or use a different provider for v3.
affects: *
gotchaRedis connection string must be correctly formatted; invalid strings cause silent errors.
fix
Verify the REDIS_URL env, e.g., redis://:password@host:port/db.
affects: *
Errors
Common errors & fixes
Provider "redisProvider" not found. Make sure the provider is installed and configured correctly.
Package not installed or missing in package.json.
fix
Run `npm install strapi-provider-rest-cache-redis` and add it to plugins config.
Cannot find module 'strapi-provider-rest-cache-redis'
Module resolution failure, possibly due to missing node_modules or incorrect import path.
fix
Check that the package is installed, and import using the exact name: 'strapi-provider-rest-cache-redis'.
ERR_INVALID_ARG_TYPE: The "connectionString" property must be of type string.
Passing a non-string as connectionString in provider options.
fix
Ensure env() returns a string or provide a default string: connectionString: env('REDIS_URL', 'redis://localhost:6379').
Upgrade
Version history
4.2.9latest on npm
Audit
Dependencies
@strapi/strapirequiredStrapi framework peer dependency
strapi-plugin-rest-cacherequiredRequired plugin that defines the provider interface
Agent activity
15 hits · last 30 days
node
12
Meta
1
Amazon
1
OpenAI (training)
1
Resources
strapi-provider-rest-cache-redis — npm install strapi-provider-rest-cache-redis · libregistry