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

Cache is not working #3

Closed jonathborg closed 2 years ago

jonathborg commented 2 years ago

I have followed the docs. I just execute with DEBUG=strapi:* yarn develop, but I dont have headers or logs about caching.

config/plugins.js

module.exports = {
  "strapi-plugin-rest-cache": {
    config: {
      provider: {
        name: "memory",
        options: {
          max: 32767,
          maxAge: 3600,
        },
      },
      strategy: {
        enableXCacheHeaders: true,
        contentTypes: [
          "api::restaurant.restaurant",
        ],
      },
    },
  },
};
eveyrat commented 2 years ago

@jonathborg I'm facing the same problem, looks like NPM packages are empty.

I've followed the docs for installing:

yarn add \
  strapi-plugin-rest-cache \
  strapi-plugin-redis \
  strapi-provider-rest-cache-redis
# package.json

"dependencies": {
    ....
    ....
    "strapi-plugin-redis": "^1.0.0-alpha.1", <= installed correctly
    "strapi-plugin-rest-cache":"^4.0.0",
    "strapi-provider-rest-cache-redis":"^4.0.0"
  },

image

I could only make it work by using local packages.

BTW, awesome plugin, thanks guys.

jerson-dp commented 2 years ago

eveyrat

I am facing the same issue..Followed as per the doc, but caching to redis is not working and not finding any logs trace on this...May I know how you managed to get it work?

stafyniaksacha commented 2 years ago

Hello!

The issue is solved on the 4.0.2!

Also note that the plugin configuration should be rest-cache instead of strapi-plugin-rest-cache