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

Add support for Strapi REST API Prefix #38

Closed derrickmehaffy closed 1 year ago

derrickmehaffy commented 1 year ago

What it does

How to test it

In your ./config/api.js set the API Prefix to anything other than /api (which is the default:

module.exports = ({ env }) => ({
  rest: {
    prefix: env('API_PREFIX', '/v1'),
    defaultLimit: env('API_DEFAULT_LIMIT', 25),
    maxLimit: env('API_MAX_LIMIT', 100),
    withCount: env('API_WITH_COUNT', true),
  },
});

And check that the content-types are still cached compared to before this PR where if the prefix is not set to /api then nothing will be cached.

derrickmehaffy commented 1 year ago

image