Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to cache only plural and not singular endpoints? #50

Open
davidkcyip opened this issue Apr 24, 2023 · 4 comments
Open

Any way to cache only plural and not singular endpoints? #50

davidkcyip opened this issue Apr 24, 2023 · 4 comments
Labels
issue: feature request Issue suggesting a new feature severity: low source: plugin version: Strapi 4 Issues related to the versions supported by Strapi 4

Comments

@davidkcyip
Copy link

Hi, as the title says, would like to only cache plural endpoints like /articles and not /articles/1

@alex-whatagraph
Copy link

+1. any idea if this is possible @stafyniaksacha ?

@stafyniaksacha
Copy link
Member

stafyniaksacha commented May 5, 2023

You will have to disable default routes (injectDefaultRoutes: false) and defines yours https://strapi-community.github.io/strapi-plugin-rest-cache/guide/strategy/cache-custom-routes.html

Let me know if that does what you needs

@alex-whatagraph
Copy link

I couldn't get this to work. Do you have an example config that I could try that caches queries to /articles, including pagination and fields returned. i.e. that would cache a query such as this:

/articles?fields[0]=id&fields[1]=title&fields[2]=slug&fields[3]=summary&populate[0]=coverImage&populate[1]=category&sort=publishedAt:desc&pagination[start]=1&pagination[limit]=12

Thanks

@kutsan
Copy link

kutsan commented Jun 13, 2023

I'd love to get help on this one too.

@derrickmehaffy derrickmehaffy added the version: Strapi 4 Issues related to the versions supported by Strapi 4 label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Issue suggesting a new feature severity: low source: plugin version: Strapi 4 Issues related to the versions supported by Strapi 4
Projects
None yet
Development

No branches or pull requests

5 participants