Caching profiles#

All persistent configuration for the caching machinery is stored in the configuration registry, as managed by

This can be modified using the registry.xml GenericSetup import step.

The Import settings tab of the control panel allows you to import these caching profiles.

Default caching profiles# includes two default caching profiles. These profiles encapsulate the cache settings that are known to work well with a typical default Plone installation:

Without caching proxy#

Settings useful for setups without a caching proxy.

With caching proxy#

Settings useful for setups with a caching proxy, such as Varnish or a CDN. The only difference from the Without caching proxy profile are some settings to enable proxy caching of files and images in content space and content feeds.

Custom caching profiles#

Caching policies are often a compromise between speed and freshness. More aggressive caching often comes at the cost of increased risk of stale responses. The provided default profiles tend to err on the side of freshness over speed, leaving room for greater speed if desired.

Customization may also be needed if third-party products are installed which require special treatment. Examine the HTTP response headers to determine whether the third-party product requires special treatment. Most simple cases probably can be solved by adding the content type or template to the appropriate mapping. More complicated cases may require custom caching operations.

A GenericSetup profile used for caching should be registered for the ICacheProfiles marker interface to distinguish it from more general profiles used to install a product. This also hides the profile from Plone's Add-ons control panel.

Here is an example from this package:

    title="With caching proxy"
    description="Settings useful for setups with a caching proxy such as Varnish or a CDN"

The directory profiles/with-caching-proxy contains a single import step, registry.xml, containing settings to configure the ruleset to operation mapping, and setting options for various operations.

At the time of writing, this includes:

<record name="plone.caching.interfaces.ICacheSettings.operationMapping">
    <value purge="False">
        <element key="plone.resource"></element>
        <element key="plone.stableResource"></element>
        <element key="plone.content.itemView"></element>
        <element key="plone.content.feed"></element>
        <element key="plone.content.folderView"></element>
        <element key="plone.content.file"></element>
        <element key="plone.content.dynamic"></element>

Default options for the various standard operations are found in the registry.xml file that is part of the standard installation profile for this product, in the directory profiles/default.

The custom profile overrides a number of operation settings for specific rulesets, as shown below.

<record name="">
    <field ref="" />

This enables RAM caching for the "weak caching" operation for resources using the ruleset plone.content.itemView. The default is defined in the main registry.xml as shown below.

<record name="">
    <field type="plone.registry.field.Bool">
        <title>RAM cache</title>
        <description>Turn on caching in Zope memory</description>

Notice how we use a field reference to avoid having to re-define the field.

It may be useful to look at the bundled registry.xml for inspiration if you are building your own caching profile. Alternatively, you can export the registry from the portal_setup tool, and pull out the records under the prefixes plone.caching and

Typically, registry.xml is all that is required, but you are free to add additional import steps if required. You can also add a metadata.xml and use the GenericSetup dependency mechanism to install other profiles on the fly.