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

Restapi caching granularity #4017

Open
cekk opened this issue Sep 24, 2024 · 3 comments
Open

Restapi caching granularity #4017

cekk opened this issue Sep 24, 2024 · 3 comments
Assignees

Comments

@cekk
Copy link
Member

cekk commented Sep 24, 2024

Now all restapi routes are configured with terseCaching.
restapi routes can have different needs so we could be able to assign different rulesets to them.

For example content GET can be cached for more time than high dynamic endpoints like @search or @querystring-search

Proposal:

  • In plone.restapi change content GETto use "plone.content.itemView" ruleset (this allows us to better tweak caching parameters)
  • Are there other endpoints that need a different cache? @navigation?
  • Could it be a good idea adding a third default preset in p.a.caching defaults, for sites with volto? Or maybe set it directly in plone.restapi or plone.volto
@cekk cekk self-assigned this Sep 24, 2024
@davisagli
Copy link
Member

For example content GET can be cached for more time than high dynamic endpoints like @search or @querystring-search

It depends... if there are API expanders enabled, then the content GET might also include data from other content items (e.g. navigation & breadcrumbs components)

@cekk
Copy link
Member Author

cekk commented Sep 25, 2024

For example content GET can be cached for more time than high dynamic endpoints like @search or @querystring-search

It depends... if there are API expanders enabled, then the content GET might also include data from other content items (e.g. navigation & breadcrumbs components)

yes, you're right, but having a separate caching ruleset allows us to potentially tweak settings only for contents.
If you don't need or don't want (because as you said there are some dynamic infos in expanders), you could stay with terse.

@folix-01
Copy link
Member

folix-01 commented Sep 27, 2024

We decided that there is no necessity to have the separated profiles. But we just give the possibility to manage granularly the caching rulesets for RestAPI Services giving the priority in caching rulesets negotiation if the service name is used in the caching operation ruleset.

Prs: plone/plone.app.caching#143 , plone/plone.rest#183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants