|
| 1 | +--- |
| 2 | +myst: |
| 3 | + html_meta: |
| 4 | + "description": "Caching composite views in Plone" |
| 5 | + "property=og:description": "Caching composite views in Plone" |
| 6 | + "property=og:title": "Caching composite views in Plone" |
| 7 | + "keywords": "Plone, deployment, automation, caching, composite views" |
| 8 | +--- |
| 9 | + |
| 10 | +(caching-composite-views-label)= |
| 11 | +# Composite views |
| 12 | + |
| 13 | +The term *composite view* refers to most of the page views that are visible on a Plone website, including views of content listings, content folders, many template views, and rarely also specific content items. |
| 14 | + |
| 15 | +These views can be difficult to manage because of the various changes that may affect the final composite view. |
| 16 | +As a result, composite views are typically challenging to remove reliably from caching proxies. |
| 17 | +To address this issue, the default caching profiles set headers that expire the cache immediately, a process known as *weak caching*. |
| 18 | + |
| 19 | +However, the inline resources linked from the composite view—such as CSS, JavaScript, and images—can typically be cached effectively in proxies. |
| 20 | +As a result, caching proxies can improve the overall speed of most composite views, even if the page itself is not cached. |
| 21 | + |
| 22 | +For relatively stable composite views or views where some staleness is tolerable, it may be tempting to switch from *weak caching* to *terse caching* with the `s-maxage` expiration value set to 60 seconds by default. |
| 23 | + |
| 24 | +To increase the speed of a site that contains many composite views, a technique called _Terse_ caching can be used. |
| 25 | +Terse caching involves caching a page for a brief period, typically 10 seconds in the browser and 60 seconds in the caching proxy. |
| 26 | +This ensures that the content is almost up to date, but during periods of high traffic, visitors may receive pages served from the cache. |
| 27 | +This technique can actually speed up a site during periods of high traffic compared to low traffic since, during high traffic, the request can be served from the cache instead of having to go to the backend. |
0 commit comments