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-Control header is not set in response. #87

Open namtx opened 7 months ago

namtx commented 7 months ago

As the title, I don't see any cache instruction headers like Cache-Control: in the API response. my current configuration:

"rest-cache": {
    config: {
      provider: {
        name: "memory",
        options: {
          max: 32767,
          maxAge: 3600,
        },
      },
      strategy: {
        maxAge: 3600000,
        contentTypes: [
          // list of Content-Types UID to cache
          "api::category.category",
          "api::printer.printer",
          "api::supporter.supporter",
          "api::seller.seller",
        ],
        enableEtag: true,
        hitpass() {
          return false;
        },
      },
    },
}
pinkasey commented 2 months ago

It's very surprising to see that a REST cache plugin does not read nor respond with the Cache-Control header.

pinkasey commented 2 months ago

I've opened a PR (https://github.com/strapi-community/strapi-plugin-rest-cache/pull/96) to add some minimal support that would help my project.

I really hope this project it maintained. I'm willing to work on this PR if there are comments.

pinkasey commented 1 month ago

It seems this package is not maintained. I've forked it to @vegan-friendly/strapi-plugin-rest-cache version 4.3.1 has this issue (and related PR) resolved.