REST API support#
This chapter describes techniques to implement caching with the Plone REST API.
Strategy#
This section desribes how to cache all GET requests from anonymous users.
Note
Some POST requests, such as @querystring, should be turned into GET to improve cache.
We have endpoints following classic plone.content.itemView content and do not accept parameters.
Those can be handled with the default rules, including purge.
There are others delivering dynamic content, such as search, which are impossible to purge. Those will be cached using a transient cache, lasting a few seconds or minutes.
This gets covered by the rulesetType plone.content.dynamic.
By default it is configured to cache in the browser for 10 seconds, and in the caching proxy server for 60 seconds.
Its primary goal is to reduce the load and peak-load on the server.
Also it reduces the impact of loading the same endpoint more than one time in one page.
plone.restapi GET endpoints#
Environment and assignments:
@actionsjAnonymous
rule
plone.content.dynamic(might be influenced by other content)purge
@addonsAuthenticated
no rule assignment
@breadcrumbsAnonymous
rule
plone.content.dynamic(parent may change)purge
@commentsAnonymous
rule
plone.content.itemViewpurge
/(content)Anonymous
expander!
rule
plone.content.dynamic
@historyAuthenticated
no rule assignment
@lockAuthenticated
no rule assignment
@translationsAnonymous
with parameters
rule
plone.content.dynamic
@translations-locatorAuthenticated
no rule assignment
@navigationAnonymous
with parameters
rule
plone.content.dynamic
@querysourcesAuthenticated
with parameters
can not be cached
@querystringAnonymous
(values on
IPloneSiteRootfrom registry)rule
plone.content.dynamic
@querystring-searchis in
get.pybut configured as POSTAnonymous
with JSON body
can not be cached
@registryAuthenticated
with subpath
no rule assignment
@rolesAuthenticated
no rule assignment
@searchAnonymous
with parameters
rule
plone.content.dynamic
@sourcesAuthenticated
no rule assignment
@tilespre-deprecation
Anonymous
with subpath
no rule assignment
@typesAuthenticated
no rule assignment