{"id":46536,"library":"strapi-provider-rest-cache-redis","title":"Strapi Redis REST Cache Provider","description":"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.","status":"active","version":"4.2.9","language":"javascript","source_language":"en","source_url":"https://github.com/strapi-community/strapi-plugin-rest-cache","tags":["javascript","strapi","provider","rest-cache","redis"],"install":[{"cmd":"npm install strapi-provider-rest-cache-redis","lang":"bash","label":"npm"},{"cmd":"yarn add strapi-provider-rest-cache-redis","lang":"bash","label":"yarn"},{"cmd":"pnpm add strapi-provider-rest-cache-redis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Strapi framework peer dependency","package":"@strapi/strapi","optional":false},{"reason":"Required plugin that defines the provider interface","package":"strapi-plugin-rest-cache","optional":false}],"imports":[{"note":"Default export, ESM only since Strapi 4 uses ESM.","wrong":"const redisProvider = require('strapi-provider-rest-cache-redis')","symbol":"redisProvider","correct":"import redisProvider from 'strapi-provider-rest-cache-redis'"},{"note":"Configure in config/plugins.js or config/plugins.ts as an ESM export.","wrong":"module.exports = ({ env }) => ({ ... })","symbol":"config","correct":"export default ({ env }) => ({\n  'rest-cache': {\n    provider: redisProvider,\n    providerOptions: {\n      connection: { connectionString: env('REDIS_URL') }\n    }\n  }\n})"},{"note":"TypeScript type for provider options, available since v4.2.0.","wrong":"","symbol":"RedisProviderOptions","correct":"import type { RedisProviderOptions } from 'strapi-provider-rest-cache-redis'"}],"quickstart":{"code":"// config/plugins.js\nimport redisProvider from 'strapi-provider-rest-cache-redis';\n\nexport default ({ env }) => ({\n  'rest-cache': {\n    config: {\n      provider: redisProvider,\n      providerOptions: {\n        connection: {\n          connectionString: env('REDIS_URL') ?? 'redis://localhost:6379',\n          enableAutoPipelining: true\n        },\n        max: 500\n      }\n    }\n  }\n});","lang":"javascript","description":"Configures the Redis cache provider for Strapi's rest-cache plugin with a default Redis URL and max cache size."},"warnings":[{"fix":"Use connection: { connectionString: '...' } instead of top-level connectionString.","message":"Provider options 'connectionString' is deprecated in favor of 'connection.connectionString' since v4.2.0.","severity":"deprecated","affected_versions":">=4.2.0"},{"fix":"Install strapi-plugin-rest-cache via npm and add it to the plugins config.","message":"Must have strapi-plugin-rest-cache installed and enabled, otherwise cache won't work.","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade to Strapi v4 or use a different provider for v3.","message":"Strapi v3 is not supported; package works only with Strapi v4.","severity":"broken","affected_versions":"*"},{"fix":"Verify the REDIS_URL env, e.g., redis://:password@host:port/db.","message":"Redis connection string must be correctly formatted; invalid strings cause silent errors.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'4':35 '4.0.0':43 '4.2.9':31 'across':76 'allow':71 'applic':28 'base':9,67 'cach':4,10,18,24,42,55,68,72,90,97 'communiti':80 'community-maintain':79 'configur':53 'connect':48 'current':29 'effici':21 'enabl':20 'follow':85 'http':22 'instanc':61,78 'integr':32 'invalid':56 'ioredi':46 'javascript':92 'maintain':81 'memori':66 'memory-bas':65 'month':83 'multi':60 'multi-inst':59 'persist':73 'plugin':16,19,40,88 'provid':5,11,70,94 'redi':2,8,50,62,98 'redis-bas':7 'releas':84 'respons':23 'rest':3,17,41,89,96 'rest-cach':95 'setup':63 'share':75 'strapi':1,15,26,34,39,77,87,93 'strapi-plugin-rest-cach':14,38,86 'strategi':57 'support':52 'ttl':54 'unlik':64 'updat':91 'use':45 'v4':27 'version':30 'x':36","created_at":"2026-06-07T13:00:24.158350+00:00","updated_at":"2026-06-07T13:00:24.158350+00:00","problems":[{"fix":"Run `npm install strapi-provider-rest-cache-redis` and add it to plugins config.","cause":"Package not installed or missing in package.json.","error":"Provider \"redisProvider\" not found. Make sure the provider is installed and configured correctly."},{"fix":"Check that the package is installed, and import using the exact name: 'strapi-provider-rest-cache-redis'.","cause":"Module resolution failure, possibly due to missing node_modules or incorrect import path.","error":"Cannot find module 'strapi-provider-rest-cache-redis'"},{"fix":"Ensure env() returns a string or provide a default string: connectionString: env('REDIS_URL', 'redis://localhost:6379').","cause":"Passing a non-string as connectionString in provider options.","error":"ERR_INVALID_ARG_TYPE: The \"connectionString\" property must be of type string."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://strapi-community.github.io/strapi-plugin-rest-cache/","github":"https://github.com/strapi-community/strapi-plugin-rest-cache","docs":null,"changelog":null,"pypi":null,"npm":"strapi-provider-rest-cache-redis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}