strapi-community / strapi-plugin-rest-cache

Speed-up HTTP requests with LRU cache.
https://strapi-community.github.io/strapi-plugin-rest-cache/
MIT License
129 stars 29 forks source link

Max measure unit + docs improvements #88

Open joaquinjsb opened 5 months ago

joaquinjsb commented 5 months ago

Hello, when using the configuration,

module.exports = {
  // Step 1: Configure the redis connection
  // @see https://github.com/strapi-community/strapi-plugin-redis
  redis: {
    // ...
  },
  // Step 2: Configure the redis cache plugin
  "rest-cache": {
    config: {
      provider: {
        name: "redis",
        options: {
          max: 32767,
          connection: "default",
        },
      },
      strategy: {
        // if you are using keyPrefix for your Redis, please add <keysPrefix>
        keysPrefix: "<redis_keyPrefix>",
        contentTypes: [
          // list of Content-Types UID to cache
          "api::category.category",
          "api::article.article",
          "api::global.global",
          "api::homepage.homepage",
        ],
      },
    },
  },
};

is the max setting in mb/kb/gb?

cipick commented 4 months ago

Hey, in this article it's mentioned that

Max denotes the maximum number of entries that the cache can take in. By default, this number is set to 32767.

So to answer your question, the measure unit is number of entries. Hope that helps you, I was also wondering what this means and I think it should be mentioned in the docs 😄

joaquinjsb commented 4 months ago

Thanks for clarifying it out for me, it should be written on the docs , probably we can just do a pull request of the docs