An LRU-Cache plugin for Strapi v5 that boosts API performance by caching REST and GraphQL responses. Current version 1.11.0, active development. Supports in-memory, Redis, and Valkey providers, with configurable TTL, max size, route exclusion, header caching, and custom key generation. Lightweight with zero overhead, integrates via Strapi's config/plugins file. Release cadence is frequent (multiple updates per month). Differentiator: dedicated Strapi v5 plugin with both REST and GraphQL caching, LRU strategy, and multiple storage backends.
npm install strapi-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Strapi v5 plugin configuration with in-memory cache: 500 items max, 30 min TTL, 100 MB size, caches /api/products and /api/categories but excludes /api/products/private, caches headers but not access-control-allow-origin.
Ensure your project runs Strapi v5.
If you need exact route matching, implement a custom keyGenerator or check the plugin source for more control.
Provide a valid Redis/Valkey URL or config object in `redisConfig`.
Order your lists accordingly; exclusions are evaluated after cacheable routes.
Monitor release notes for final Valkey support. Prefer Redis for production.
Run `npm install strapi-cache` in your project root.
Use `env` only inside config/plugins.{js,ts} or config/database.{js,ts} without importing. If needed elsewhere, import from '@strapi/strapi': `import { env } from '@strapi/strapi';`Set `provider: 'redis'` (or 'valkey') in the config object.
Stop other Strapi instances or change the port in config/server.js via `yarn develop --port 1338`.