
Speed-up HTTP requests with LRU cache
released August 14, 2026
npm install @strapi-community/plugin-rest-cacheA caching layer for the Strapi REST API. It injects a middleware that stores GET
responses, keyed by route and query, and invalidates them when the underlying
content changes — so you serve cached responses without serving stale ones.
Cached content lives in a provider (in-memory, Redis, or your own). What gets cached, and for how long, is described by a strategy in your plugin config.

@strapi-community/provider-rest-cache-redis. Custom providers implement the
CacheProvider abstract class.maxAge,
paramNames and key strategy.keys.useQueryParams),
specific request headers (keys.useHeaders), and — since 5.1.0 — on the
authenticated caller (keys.useAuth), so two callers authorised for the same
route do not share one entry.strapi.documents() rather than HTTP routes, so it catches
GraphQL mutations, admin panel edits, scheduled Content Releases and any custom
strapi.documents() call — not only REST writes. Related content types can be
purged alongside (clearRelatedCache).304 Not Modified support (enableEtag).X-Cache response headers — HIT, MISS, HITPASS (enableXCacheHeaders).Authorization header or a cookie.enableContentApiPurge).>= 5.0.0>= 20Looking for Strapi v4? Use the legacy package. Looking for Strapi v3? Use strapi-middleware-cache.
Install the plugin.
npm:
npm install @strapi-community/plugin-rest-cacheyarn:
yarn add @strapi-community/plugin-rest-cachepnpm:
pnpm add @strapi-community/plugin-rest-cacheThen list the content types you want cached in ./config/plugins.js:
module.exports = {
'rest-cache': {
config: {
provider: {
name: 'memory',
options: {
maxSize: 32767,
},
},
strategy: {
contentTypes: [
'api::category.category',
'api::article.article',
'api::homepage.homepage',
],
},
},
},
};That caches the default find and findOne routes of those content types for one
hour (maxAge, in milliseconds) and purges them when their content changes.
For Redis, install @strapi-community/plugin-redis and
@strapi-community/provider-rest-cache-redis alongside the plugin and set
provider.name to redis — see the
installation guide.
Full documentation lives at strapi-community.github.io/plugin-rest-cache.
Contributors and maintainers are wanted. See CONTRIBUTING.md for the repo layout, how to run the playgrounds, and how to run the test suites. Bugs and feature requests go in issues.
See the LICENSE file for licensing information.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
