strapi-plugin-rest-cache icon indicating copy to clipboard operation
strapi-plugin-rest-cache copied to clipboard

Cache-Control header is not set in response.

Open namtx opened this issue 1 year ago • 3 comments

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;
        },
      },
    },
}

namtx avatar Apr 08 '24 12:04 namtx

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

pinkasey avatar Sep 15 '24 07:09 pinkasey

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 avatar Sep 19 '24 19:09 pinkasey

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.

pinkasey avatar Oct 02 '24 16:10 pinkasey