Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upgrade step for terse caching #83

Merged
merged 3 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/82.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add upgrade step to define the new base terse cache setting.
[maurits]
17 changes: 1 addition & 16 deletions plone/app/caching/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="plone">

<include package="z3c.zcmlhook" file="meta.zcml" />
Expand All @@ -14,21 +13,7 @@

<include package=".browser" />
<include package=".operations" />

<genericsetup:registerProfile
name="default"
title="HTTP caching support"
directory="profiles/default"
description="Installs plone.app.caching"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:importStep
name="plone.app.caching"
title="Plone caching - additional installation steps"
description="Imperative configuration for plone.app.caching"
handler=".setuphandlers.importVarious"
/>
<include file="profiles.zcml" />

<zcml:customAction
handler=".setuphandlers.enableExplicitMode"
Expand Down
2 changes: 1 addition & 1 deletion plone/app/caching/operations/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<adapter factory=".default.NoCaching" name="plone.app.caching.noCaching" />
<utility component=".default.NoCaching" name="plone.app.caching.noCaching" />

<!-- Uncomment to show the "Generic caching" in the UI (also see profiles/default/registry.xml)
<!-- Uncomment to show the "Generic caching" in the UI (also see profiles/default/registry/generic.xml)
<adapter factory=".default.BaseCaching" name="plone.app.caching.baseCaching" />
<utility component=".default.BaseCaching" name="plone.app.caching.baseCaching" />
-->
Expand Down
39 changes: 39 additions & 0 deletions plone/app/caching/profiles.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="plone">

<genericsetup:registerProfile
name="default"
title="HTTP caching support"
directory="profiles/default"
description="Installs plone.app.caching"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
name="v2"
title="Upgrade plone.app.caching to v2 with terse caching"
directory="profiles/default"
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:importStep
name="plone.app.caching"
title="Plone caching - additional installation steps"
description="Imperative configuration for plone.app.caching"
handler=".setuphandlers.importVarious"
/>

<genericsetup:upgradeSteps
source="1"
destination="2"
profile="plone.app.caching:default">
<genericsetup:upgradeDepends
title="Upgrade plone.app.caching to v2 with terse caching"
import_profile="plone.app.caching:v2"
/>
</genericsetup:upgradeSteps>

</configure>
2 changes: 1 addition & 1 deletion plone/app/caching/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<metadata>
<version>1</version>
<version>2</version>
<dependencies>
<dependency>profile-plone.app.registry:default</dependency>
</dependencies>
Expand Down
279 changes: 0 additions & 279 deletions plone/app/caching/profiles/default/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
<!-- Default content type/template mappings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<!-- <record name="plone.app.caching.interfaces.IPloneCacheSettings.contentTypeRulesetMapping">
<value purge="False">
</value>
</record> -->

<record name="plone.app.caching.interfaces.IPloneCacheSettings.templateRulesetMapping">
<value purge="False">
Expand Down Expand Up @@ -53,279 +49,4 @@
<value></value>
</record>


<!-- Weak caching -->
<record name="plone.app.caching.weakCaching.etags">
<field type="plone.registry.field.Tuple">
<title>ETags</title>
<description>A list of ETag component names to include</description>
<value_type type="plone.registry.field.ASCIILine" />
<required>False</required>
</field>
<value>
</value>
</record>
<record name="plone.app.caching.weakCaching.lastModified">
<field type="plone.registry.field.Bool">
<title>Last-modified validation</title>
<description>Turn on Last-Modified headers</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.weakCaching.ramCache">
<field type="plone.registry.field.Bool">
<title>RAM cache</title>
<description>Turn on caching in Zope memory</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.weakCaching.vary">
<field type="plone.registry.field.ASCIILine">
<title>Vary</title>
<description>Name(s) of HTTP headers that must match for the caching proxy to return a cached response</description>
<required>False</required>
</field>
<value></value>
</record>
<record name="plone.app.caching.weakCaching.anonOnly">
<field type="plone.registry.field.Bool">
<title>Only cache for anonymous users</title>
<description>Ensure logging users always get a fresh page. Note that if you are caching pages in a proxy cache, you'll still need to use a Vary response header to keep anonymous and authenticated content separate.</description>
<required>False</required>
</field>
<value>False</value>
</record>


<!-- Terse caching -->
<record name="plone.app.caching.terseCaching.maxage">
<field type="plone.registry.field.Int">
<title>Maximum age</title>
<description>Time (in seconds) to cache the response in the browser</description>
<required>False</required>
</field>
<value>10</value>
</record>
<record name="plone.app.caching.terseCaching.smaxage">
<field type="plone.registry.field.Int">
<title>Shared maximum age</title>
<description>Time (in seconds) to cache the response in the caching proxy</description>
<required>False</required>
</field>
<value>60</value>
</record>
<record name="plone.app.caching.terseCaching.etags">
<field type="plone.registry.field.Tuple">
<title>ETags</title>
<description>A list of ETag component names to include</description>
<value_type type="plone.registry.field.ASCIILine" />
<required>False</required>
</field>
<value>
</value>
</record>
<record name="plone.app.caching.terseCaching.lastModified">
<field type="plone.registry.field.Bool">
<title>Last-modified validation</title>
<description>Turn on Last-Modified headers</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.terseCaching.ramCache">
<field type="plone.registry.field.Bool">
<title>RAM cache</title>
<description>Turn on caching in Zope memory</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.terseCaching.vary">
<field type="plone.registry.field.ASCIILine">
<title>Vary</title>
<description>Name(s) of HTTP headers that must match for the caching proxy to return a cached response</description>
<required>False</required>
</field>
<value></value>
</record>
<record name="plone.app.caching.terseCaching.anonOnly">
<field type="plone.registry.field.Bool">
<title>Only cache for anonymous users</title>
<description>Ensure logging users always get a fresh page. Note that if you are caching pages in a proxy cache, you'll still need to use a Vary response header to keep anonymous and authenticated content separate.</description>
<required>False</required>
</field>
<value>False</value>
</record>


<!-- Moderate caching -->
<record name="plone.app.caching.moderateCaching.smaxage">
<field type="plone.registry.field.Int">
<title>Shared maximum age</title>
<description>Time (in seconds) to cache the response in the caching proxy</description>
<required>False</required>
</field>
<value>86400</value>
</record>
<record name="plone.app.caching.moderateCaching.etags">
<field type="plone.registry.field.Tuple">
<title>ETags</title>
<description>A list of ETag component names to include</description>
<value_type type="plone.registry.field.ASCIILine" />
<required>False</required>
</field>
<value>
</value>
</record>
<record name="plone.app.caching.moderateCaching.lastModified">
<field type="plone.registry.field.Bool">
<title>Last-modified validation</title>
<description>Turn on Last-Modified headers</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.moderateCaching.ramCache">
<field type="plone.registry.field.Bool">
<title>RAM cache</title>
<description>Turn on caching in Zope memory</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.moderateCaching.vary">
<field type="plone.registry.field.ASCIILine">
<title>Vary</title>
<description>Name(s) of HTTP headers that must match for the caching proxy to return a cached response</description>
<required>False</required>
</field>
<value></value>
</record>
<record name="plone.app.caching.moderateCaching.anonOnly">
<field type="plone.registry.field.Bool">
<title>Only cache for anonymous users</title>
<description>Ensure logging users always get a fresh page. Note that if you are caching pages in a proxy cache, you'll still need to use a Vary response header to keep anonymous and authenticated content separate.</description>
<required>False</required>
</field>
<value>False</value>
</record>

<!-- Strong caching -->
<record name="plone.app.caching.strongCaching.maxage">
<field type="plone.registry.field.Int">
<title>Maximum age</title>
<description>Time (in seconds) to cache the response in the browser or caching proxy</description>
<required>False</required>
</field>
<value>86400</value>
</record>
<record name="plone.app.caching.strongCaching.smaxage">
<field type="plone.registry.field.Int">
<title>Shared maximum age</title>
<description>Time (in seconds) to cache the response in the caching proxy. Leave blank to use value from "Maximum age" field.</description>
<required>False</required>
</field>
<value></value>
</record>
<record name="plone.app.caching.strongCaching.etags">
<field type="plone.registry.field.Tuple">
<title>ETags</title>
<description>A list of ETag component names to include</description>
<value_type type="plone.registry.field.ASCIILine" />
<required>False</required>
</field>
<value>
</value>
</record>
<record name="plone.app.caching.strongCaching.lastModified">
<field type="plone.registry.field.Bool">
<title>Last-modified validation</title>
<description>Turn on Last-Modified headers</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.strongCaching.ramCache">
<field type="plone.registry.field.Bool">
<title>RAM cache</title>
<description>Turn on caching in Zope memory</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.strongCaching.vary">
<field type="plone.registry.field.ASCIILine">
<title>Vary</title>
<description>Name(s) of HTTP headers that must match for the caching proxy to return a cached response</description>
<required>False</required>
</field>
<value></value>
</record>
<record name="plone.app.caching.strongCaching.anonOnly">
<field type="plone.registry.field.Bool">
<title>Only cache for anonymous users</title>
<description>Ensure logging users always get a fresh page. Note that if you are caching pages in a proxy cache, you'll still need to use a Vary response header to keep anonymous and authenticated content separate.</description>
<required>False</required>
</field>
<value>False</value>
</record>

<!-- Uncomment if showing "Generic caching" in the UI.
Also see operations/configure.zcml

<record name="plone.app.caching.baseCaching.maxage">
<field type="plone.registry.field.Int">
<title>Maximum age</title>
<description>Time (in seconds) to cache the response in the browser or caching proxy</description>
<required>False</required>
</field>
<value></value>
</record>
<record name="plone.app.caching.baseCaching.smaxage">
<field type="plone.registry.field.Int">
<title>Shared maximum age</title>
<description>Time (in seconds) to cache the response in the caching proxy. Leave blank to use value from "Maximum age" field.</description>
<required>False</required>
</field>
<value></value>
</record>
<record name="plone.app.caching.baseCaching.etags">
<field type="plone.registry.field.Tuple">
<title>ETags</title>
<description>A list of ETag component names to include</description>
<value_type type="plone.registry.field.ASCIILine" />
<required>False</required>
</field>
<value>
</value>
</record>
<record name="plone.app.caching.baseCaching.lastModified">
<field type="plone.registry.field.Bool">
<title>Last-modified validation</title>
<description>Turn on Last-Modified headers</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.baseCaching.ramCache">
<field type="plone.registry.field.Bool">
<title>RAM cache</title>
<description>Turn on caching in Zope memory</description>
<required>False</required>
</field>
<value>False</value>
</record>
<record name="plone.app.caching.baseCaching.vary">
<field type="plone.registry.field.ASCIILine">
<title>Vary</title>
<description>Name(s) of HTTP headers that must match for the caching proxy to return a cached response</description>
<required>False</required>
</field>
<value></value>
</record>
-->


</registry>
Loading