Caching in Strapi with REST Cache Plugin

Most firms strive to retrieve and store data faster. It is because no one wants an application that lags. When there's a lot of data in the database, it becomes challenging to fetch data from the database swiftly, which may cause your application to lag. To avoid this, most software firms cache data.


This is a companion discussion topic for the original entry at https://strapi.io/blog/caching-in-strapi-with-rest-cache-plugin

This not working for me. With the same configuration. I am getting this log

[2023-11-23 00:00:22.479] info: File changed: /Users/nitindutta5/Desktop/my-project/backend/config/plugin.js
[2023-11-23 00:00:24.144] info: Using REST Cache plugin with provider “memory”

Put this code before the rest-cache

redis: {
    config: {
      connections: {
        default: {
          connection: {
            host: '127.0.0.1',
            port: 6379,
            db: 0,
          },
          settings: {
            debug: false,
          },
        },
      },
    },
  },

There is an issue with redis plugin but you can use the following workaround.

    "strapi-plugin-redis": "1.0.1",
    "strapi-plugin-rest-cache": "4.2.8",
    "strapi-provider-rest-cache-redis": "4.2.8"

Can it work with GraphQL ?

I don’t think this plugin works with GraphQl

How can i set to cache an api i created that is not related to a content-type? i just have the path and method