Skip to content

Commit 2b092b1

Browse files
committed
Tidy up restapi.md
1 parent ce1fa71 commit 2b092b1

File tree

1 file changed

+90
-86
lines changed

1 file changed

+90
-86
lines changed

docs/deployment/caching/restapi.md

Lines changed: 90 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,147 @@
11
---
22
myst:
33
html_meta:
4-
"description": "Caching support for Rest API"
5-
"property=og:description": "Caching support for Rest API"
6-
"property=og:title": "Caching support for Rest API"
4+
"description": "Caching support for Plone REST API"
5+
"property=og:description": "Caching support for Plone REST API"
6+
"property=og:title": "Caching support for Plone REST API"
77
"keywords": "Plone, deployment, automation, caching"
88
---
99

1010
(caching-restapi-label)=
1111

12-
# Rest API support
12+
# REST API support
13+
14+
This chapter describes techniques to implement caching with the Plone REST API.
1315

1416
## Strategy
1517

16-
Caching for anonymous users for all GET requests.
18+
This section desribes how to cache all GET requests from anonymous users.
1719

18-
Remark: Some POST requests, like `@querystring`, should be turned into GET in order to better cache.
20+
```{note}
21+
Some POST requests, such as `@querystring`, should be turned into GET to improve cache.
22+
```
1923

2024
We have endpoints following classic `plone.content.itemView` content and do not accept parameters.
2125
Those can be handled with the default rules, including purge.
2226

23-
There are others delivering dynamic content, like search, impossible to purge.
24-
Those shall be cached using a shorttime cache (like some seconds to some minutes).
25-
26-
This get covered by the rulesetType `plone.content.dynamic`.
27-
It is configured to cache by default in browser 10sec, in caching-proxy 60 seconds.
28-
Its goal is primary to reduce the load/peak-load on the server.
29-
Also, it reduces the impact of loading the same endpoint more than one time in one page.
27+
There are others delivering dynamic content, such as search, which are impossible to purge.
28+
Those will be cached using a transient cache, lasting a few seconds or minutes.
3029

30+
This gets covered by the `rulesetType` `plone.content.dynamic`.
31+
By default it is configured to cache in the browser for 10 seconds, and in the caching proxy server for 60 seconds.
32+
Its primary goal is to reduce the load and peak-load on the server.
33+
Also it reduces the impact of loading the same endpoint more than one time in one page.
3134

32-
## plone.restapi GET endpoints
3335

34-
And its environment and assignments:
36+
## `plone.restapi` GET endpoints
3537

36-
- `@actions`
38+
Environment and assignments:
3739

38-
- Anonymous
39-
- rule plone.content.dynamic (might be influenced by other content)
40-
- purge
40+
- `@actions`
41+
j
42+
- Anonymous
43+
- rule `plone.content.dynamic` (might be influenced by other content)
44+
- purge
4145

42-
- `@addons`
46+
- `@addons`
4347

44-
- Authenticated
45-
- no rule assignment
48+
- Authenticated
49+
- no rule assignment
4650

47-
- `@breadcrumbs`
51+
- `@breadcrumbs`
4852

49-
- Anonymous
50-
- rule plone.content.dynamic (parent may change)
51-
- purge
53+
- Anonymous
54+
- rule `plone.content.dynamic` (parent may change)
55+
- purge
5256

53-
- `@comments`
57+
- `@comments`
5458

55-
- Anonymous
56-
- rule plone.content.itemView
57-
- purge
59+
- Anonymous
60+
- rule `plone.content.itemView`
61+
- purge
5862

59-
- `/` (content)
63+
- `/` (content)
6064

61-
- Anonymous
62-
- expander!
63-
- rule plone.content.dynamic
65+
- Anonymous
66+
- expander!
67+
- rule `plone.content.dynamic`
6468

65-
- `@history`
69+
- `@history`
6670

67-
- Authenticated
68-
- no rule assignment
71+
- Authenticated
72+
- no rule assignment
6973

70-
- `@lock`
74+
- `@lock`
7175

72-
- Authenticated
73-
- no rule assignment
76+
- Authenticated
77+
- no rule assignment
7478

75-
- `@translations`
79+
- `@translations`
7680

77-
- Anonymous
78-
- with parameters
79-
- rule plone.content.dynamic
81+
- Anonymous
82+
- with parameters
83+
- rule `plone.content.dynamic`
8084

81-
- `@translations-locator`
85+
- `@translations-locator`
8286

83-
- Authenticated
84-
- no rule assignment
87+
- Authenticated
88+
- no rule assignment
8589

86-
- `@navigation`
90+
- `@navigation`
8791

88-
- Anonymous
89-
- with parameters
90-
- rule plone.content.dynamic
92+
- Anonymous
93+
- with parameters
94+
- rule `plone.content.dynamic`
9195

92-
- `@querysources`
96+
- `@querysources`
9397

94-
- Authenticated
95-
- with parameters
96-
- can not be cached
98+
- Authenticated
99+
- with parameters
100+
- can not be cached
97101

98-
- `@querystring`
102+
- `@querystring`
99103

100-
- Anonymous
101-
- (values on IPloneSiteRoot from registry)
102-
- rule plone.content.dynamic
104+
- Anonymous
105+
- (values on `IPloneSiteRoot` from registry)
106+
- rule `plone.content.dynamic`
103107

104-
- `@querystring-search`
108+
- `@querystring-search`
105109

106-
- is in `get.py` BUT configured as POST
107-
- Anonymous
108-
- with json body
109-
- can not be cached
110+
- is in `get.py` but configured as POST
111+
- Anonymous
112+
- with JSON body
113+
- can not be cached
110114

111-
- `@registry`
115+
- `@registry`
112116

113-
- Authenticated
114-
- with subpath
115-
- no rule assignment
117+
- Authenticated
118+
- with subpath
119+
- no rule assignment
116120

117-
- `@roles`
121+
- `@roles`
118122

119-
- Authenticated
120-
- no rule assignment
123+
- Authenticated
124+
- no rule assignment
121125

122-
- `@search`
126+
- `@search`
123127

124-
- Anonymous
125-
- with parameters
126-
- rule plone.content.dynamic
128+
- Anonymous
129+
- with parameters
130+
- rule `plone.content.dynamic`
127131

128-
- `@sources`
132+
- `@sources`
129133

130-
- Authenticated
131-
- no rule assignment
134+
- Authenticated
135+
- no rule assignment
132136

133-
- `@tiles`
137+
- `@tiles`
134138

135-
- pre-deprecation
136-
- Anonymous
137-
- with subpath
138-
- no rule assignment
139+
- pre-deprecation
140+
- Anonymous
141+
- with subpath
142+
- no rule assignment
139143

140-
- `@types`
144+
- `@types`
141145

142-
- Authenticated
143-
- no rule assignment
146+
- Authenticated
147+
- no rule assignment

0 commit comments

Comments
 (0)