npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@strapi-community/provider-rest-cache-redis

v5.1.0

Published

Speed-up HTTP requests with LRU cache

Readme

Stores cache entries in Redis, so every Strapi instance shares one cache and a purge on any of them clears it everywhere.

Use this as soon as you run more than one instance, or whenever the cache should survive a restart.

KeyDB and Valkey speak the same protocol and work with this provider unchanged.

Install

Three packages: the plugin, this provider, and the Redis connection plugin that owns the client.

npm install @strapi-community/plugin-rest-cache @strapi-community/plugin-redis @strapi-community/provider-rest-cache-redis
yarn add @strapi-community/plugin-rest-cache @strapi-community/plugin-redis @strapi-community/provider-rest-cache-redis
pnpm add @strapi-community/plugin-rest-cache @strapi-community/plugin-redis @strapi-community/provider-rest-cache-redis

Configure

// ./config/plugins.js
module.exports = ({ env }) => ({
  // The connection is owned by @strapi-community/plugin-redis.
  redis: {
    config: {
      connections: {
        default: {
          connection: {
            host: env("REDIS_HOST", "127.0.0.1"),
            port: env.int("REDIS_PORT", 6379),
            db: 0,
          },
        },
      },
    },
  },

  "rest-cache": {
    config: {
      provider: {
        name: "redis",
        options: {
          // Names a connection defined above.
          connection: "default",
        },
      },
      strategy: {
        // Must match your Redis client's keyPrefix, if it sets one.
        keysPrefix: "",
        contentTypes: ["api::article.article"],
      },
    },
  },
});
// ./config/plugins.ts
export default ({ env }) => ({
  redis: {
    config: {
      connections: {
        default: {
          connection: {
            host: env("REDIS_HOST", "127.0.0.1"),
            port: env.int("REDIS_PORT", 6379),
            db: 0,
          },
        },
      },
    },
  },

  "rest-cache": {
    config: {
      provider: {
        name: "redis",
        options: {
          connection: "default",
        },
      },
      strategy: {
        keysPrefix: "",
        contentTypes: ["api::article.article"],
      },
    },
  },
});

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | connection | string | "default" | Which connection from @strapi-community/plugin-redis to use. | | ttl | number (ms) | — | Store-level default lifetime. The plugin passes an explicit lifetime on every write from strategy.maxAge, so this is only a backstop. |

Any other option is passed through to @keyv/redis.

If your Redis client sets a keyPrefix, set strategy.keysPrefix to match. A mismatch means the plugin enumerates none of its own keys, so every purge silently does nothing.

Redis Cluster

Supported. Deletes are issued key by key when clustered, because a multi-key UNLINK spanning hash slots is rejected outright:

CROSSSLOT Keys in request don't hash to the same slot

Key enumeration reads the adapter's own tracking set — a single SMEMBERS — rather than scanning the keyspace. On a 100k-entry cache the scanning approach measured roughly 20,000 round trips and 55MB transferred.

KeyDB and Valkey

Both are Redis-protocol compatible; point the connection at them and change nothing else.

connection: {
  host: env("KEYDB_HOST", "127.0.0.1"),
  port: env.int("KEYDB_PORT", 6379),
}

Documentation

License

See the LICENSE file.