Skip to content

Commit 0cb6ffc

Browse files
committed
Tidy up etags.md
1 parent fc4b22c commit 0cb6ffc

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

docs/deployment/caching/etags.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
myst:
33
html_meta:
4-
"description": "ETags support for Plone caching"
5-
"property=og:description": "ETags support for Plone caching"
6-
"property=og:title": "ETags support for Plone"
4+
"description": "ETags support for caching in Plone"
5+
"property=og:description": "ETags support for caching in Plone"
6+
"property=og:title": "ETags support for caching in Plone"
77
"keywords": "Plone, deployment, automation, caching"
88
---
99

@@ -13,25 +13,26 @@ myst:
1313

1414
ETags are used in to determine whether pages need to be re-calculated or can be served from cache.
1515
An ETag generated by `plone.app.caching` is a string of tokens separated by pipe characters that hold values like a user ID, the current skin name, or a counter indicating how many objects have been added to the site.
16-
This technique is used to quickly calculate the current ETag for the requested resource.
17-
The browser sends a request with the ETag included in an `If-None-Match` header, and if the ETag is the same, Plone responds with a 304 NOT MODIFIED message, indicating that the browser should use its cached copy.
18-
If the ETag is different, Plone renders the page and returns it as normal.
16+
This technique is used to quickly calculate the current ETag for the requested resource.
17+
The browser sends a request with the ETag included in an `If-None-Match` header.
18+
If the ETag is the same, then Plone responds with a `304 NOT MODIFIED` message, indicating that the browser should use its cached copy.
19+
If the ETag is different, then Plone renders the page and returns it as usual.
1920

2021
Many caching operations use ETags.
2122
The tokens to include are typically listed in an `etags` tuple in the operation's options.
2223

2324
## Default tokens
2425

25-
The ETag names tokens supported by default are:
26+
The ETag token names supported by default are:
2627

2728
| etag | description |
2829
| --- | --- |
29-
| userid | The current user's id .|
30+
| userid | The current user's ID.|
3031
| roles | A list of the current user's roles in the given context. |
3132
| language | The language(s) accepted by the browser, in the `ACCEPT_LANGUAGE` header. |
3233
| userLanguage | The current user's preferred language. |
3334
| lastModified | A timestamp indicating the last-modified date of the given context. |
34-
| catalogCounter | A counter that is incremented each time the catalog is updated. I.e. each time content in the site is changed. |
35+
| catalogCounter | A counter that is incremented each time the catalog is updated, such as when content in the site is changed. |
3536
| locked | Whether or not the given context is locked for editing. |
3637
| skin | The name of the current skin (theme). |
3738
| resourceRegistries | A timestamp indicating the last-modified timestamp for the Resource Registries. This is useful for avoiding requests for expired resources from cached pages. |
@@ -40,12 +41,12 @@ The ETag names tokens supported by default are:
4041

4142
It is possible to provide additional tokens by registering an `IETagValue` adapter.
4243

43-
This should be a named adapter on the published object (typically a view, file resource or Zope page template object) and request, with a unique name.
44+
This should be a named adapter on the published object (typically a view, file resource, or Zope page template object) and request, with a unique name.
4445

4546
The name is used to look up the component.
46-
Thus, you can also override one of the tokens above for a particular type of context or request (e.g. via a browser layer), by registering a more specific adapter with the same name.
47+
Thus you can override one of the tokens above for a particular type of context or request, including via a browser layer, by registering a more specific adapter with the same name.
4748

48-
As an example, here is the `language` adapter:
49+
As an example, here is the `language` adapter.
4950

5051
```python
5152
from plone.app.caching.interfaces import IETagValue
@@ -68,7 +69,7 @@ class Language:
6869
return self.request.get('HTTP_ACCEPT_LANGUAGE', '')
6970
```
7071

71-
This is registered in `ZCML` like so:
72+
This is registered in `ZCML` as shown below.
7273

7374
```xml
7475
<adapter factory=".etags.Language" name="language" />

0 commit comments

Comments
 (0)