Commit d26b78d7 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web] Hateoas web section should not cache by default

Even in case of 401 HTTP code, IOS Safari caches query result, and so, prevent user to get result after being logged in.

Force no-cache header if the Hateoas rendering script does not explicitely request cache configuration.
parent 5c81e22a
...@@ -6,6 +6,20 @@ ...@@ -6,6 +6,20 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_cache</string> </key>
<value>
<object>
<klass>
<global name="CPMCache" module="Products.CMFCore.CachingPolicyManager"/>
</klass>
<tuple/>
<state>
<dictionary/>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>_policies</string> </key> <key> <string>_policies</string> </key>
<value> <value>
...@@ -21,10 +35,11 @@ ...@@ -21,10 +35,11 @@
<string>one-hour-max-modification-date</string> <string>one-hour-max-modification-date</string>
<string>must-revalidate</string> <string>must-revalidate</string>
<string>public-conversion-result-no-language</string> <string>public-conversion-result-no-language</string>
<string>hateoas</string>
<string>hateoas-no-cache</string>
<string>public-conversion-result</string> <string>public-conversion-result</string>
<string>unauthenticated no language</string> <string>unauthenticated no language</string>
<string>unauthenticated</string> <string>unauthenticated</string>
<string>hateoas</string>
<string>authenticated</string> <string>authenticated</string>
</tuple> </tuple>
</value> </value>
...@@ -254,6 +269,111 @@ ...@@ -254,6 +269,111 @@
</object> </object>
</value> </value>
</item> </item>
<item>
<key> <string>hateoas-no-cache</string> </key>
<value>
<object>
<klass> <reference id="2.1"/> </klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_enable_304s</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_etag_func</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAk=</string> </persistent>
</value>
</item>
<item>
<key> <string>_last_modified</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_max_age_secs</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_mtime_func</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAo=</string> </persistent>
</value>
</item>
<item>
<key> <string>_must_revalidate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_no_cache</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_no_store</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_no_transform</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_policy_id</string> </key>
<value> <string>hateoas-no-cache</string> </value>
</item>
<item>
<key> <string>_post_check</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_pre_check</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_predicate</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAs=</string> </persistent>
</value>
</item>
<item>
<key> <string>_private</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_proxy_revalidate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_public</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_s_max_age_secs</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_stale_if_error_secs</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_stale_while_revalidate_secs</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_vary</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>must-revalidate</string> </key> <key> <string>must-revalidate</string> </key>
<value> <value>
...@@ -269,7 +389,7 @@ ...@@ -269,7 +389,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAk=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAw=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -283,7 +403,7 @@ ...@@ -283,7 +403,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAo=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAA0=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -321,7 +441,7 @@ ...@@ -321,7 +441,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAs=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAA4=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -374,7 +494,7 @@ ...@@ -374,7 +494,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAw=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAA8=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -388,7 +508,7 @@ ...@@ -388,7 +508,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAA0=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABA=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -426,7 +546,7 @@ ...@@ -426,7 +546,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAA4=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABE=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -479,7 +599,7 @@ ...@@ -479,7 +599,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAA8=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABI=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -493,7 +613,7 @@ ...@@ -493,7 +613,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABA=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -531,7 +651,7 @@ ...@@ -531,7 +651,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABE=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -584,7 +704,7 @@ ...@@ -584,7 +704,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABU=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -598,7 +718,7 @@ ...@@ -598,7 +718,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABY=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -636,7 +756,7 @@ ...@@ -636,7 +756,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABc=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -689,7 +809,7 @@ ...@@ -689,7 +809,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABU=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABg=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -703,7 +823,7 @@ ...@@ -703,7 +823,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABY=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABk=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -741,7 +861,7 @@ ...@@ -741,7 +861,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABc=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABo=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -794,7 +914,7 @@ ...@@ -794,7 +914,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABg=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABs=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -808,7 +928,7 @@ ...@@ -808,7 +928,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABk=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAABw=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -846,7 +966,7 @@ ...@@ -846,7 +966,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABo=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAB0=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -899,7 +1019,7 @@ ...@@ -899,7 +1019,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABs=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAB4=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -913,7 +1033,7 @@ ...@@ -913,7 +1033,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAABw=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAB8=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -951,7 +1071,7 @@ ...@@ -951,7 +1071,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAB0=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAACA=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -1004,7 +1124,7 @@ ...@@ -1004,7 +1124,7 @@
<item> <item>
<key> <string>_etag_func</string> </key> <key> <string>_etag_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAB4=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAACE=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -1018,7 +1138,7 @@ ...@@ -1018,7 +1138,7 @@
<item> <item>
<key> <string>_mtime_func</string> </key> <key> <string>_mtime_func</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAB8=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAACI=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -1056,7 +1176,7 @@ ...@@ -1056,7 +1176,7 @@
<item> <item>
<key> <string>_predicate</string> </key> <key> <string>_predicate</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAACA=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAACM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -1199,7 +1319,7 @@ ...@@ -1199,7 +1319,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: getattr(object, \'getModificationDate\', object.modified)()</string> </value> <value> <string>object/modified</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1212,7 +1332,7 @@ ...@@ -1212,7 +1332,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: (lambda x: x is not None and x.getCachingPolicy() == \'must-revalidate\')(object.getWebSectionValue())</string> </value> <value> <string>python: (lambda x: x is not None and x.getCachingPolicy() =="hateoas")(object.getWebSectionValue())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1238,7 +1358,7 @@ ...@@ -1238,7 +1358,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>object/modified</string> </value> <value> <string>python: getattr(object, \'getModificationDate\', object.modified)()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1251,7 +1371,7 @@ ...@@ -1251,7 +1371,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: member is None and (lambda x: x is not None and x.getCachingPolicy() == \'no-cache\')(object.getWebSectionValue())</string> </value> <value> <string>python: (lambda x: x is not None and x.getCachingPolicy() == \'must-revalidate\')(object.getWebSectionValue())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1277,7 +1397,7 @@ ...@@ -1277,7 +1397,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: max(getattr(object, \'Base_getWebDocumentDrivenModificationDate\', object.modified)(), DateTime().earliestTime())</string> </value> <value> <string>object/modified</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1290,7 +1410,7 @@ ...@@ -1290,7 +1410,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: member is None and (lambda x: x is not None and x.getCachingPolicy() == \'one-day-max-modification-date\')(object.getWebSectionValue())</string> </value> <value> <string>python: member is None and (lambda x: x is not None and x.getCachingPolicy() == \'no-cache\')(object.getWebSectionValue())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1316,7 +1436,7 @@ ...@@ -1316,7 +1436,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: max(getattr(object, \'Base_getWebDocumentDrivenModificationDate\', object.modified)(), DateTime().earliestTime() + (DateTime().hour() /24.0))</string> </value> <value> <string>python: max(getattr(object, \'Base_getWebDocumentDrivenModificationDate\', object.modified)(), DateTime().earliestTime())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1329,7 +1449,7 @@ ...@@ -1329,7 +1449,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: member is None and (lambda x: x is not None and x.getCachingPolicy() == \'one-hour-max-modification-date\')(object.getWebSectionValue())</string> </value> <value> <string>python: member is None and (lambda x: x is not None and x.getCachingPolicy() == \'one-day-max-modification-date\')(object.getWebSectionValue())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1355,7 +1475,7 @@ ...@@ -1355,7 +1475,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: getattr(object, \'getModificationDate\', object.modified)()</string> </value> <value> <string>python: max(getattr(object, \'Base_getWebDocumentDrivenModificationDate\', object.modified)(), DateTime().earliestTime() + (DateTime().hour() /24.0))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1368,7 +1488,7 @@ ...@@ -1368,7 +1488,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: object.Base_isPublicConvertionResult() and (lambda x: x is not None and not (len(x.getAvailableLanguageSet()) == 1 or x.getStaticLanguageSelection()))(object.getWebSectionValue())</string> </value> <value> <string>python: member is None and (lambda x: x is not None and x.getCachingPolicy() == \'one-hour-max-modification-date\')(object.getWebSectionValue())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1407,7 +1527,7 @@ ...@@ -1407,7 +1527,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: object.Base_isPublicConvertionResult() and (lambda x: x is not None and (len(x.getAvailableLanguageSet()) == 1 or x.getStaticLanguageSelection()))(object.getWebSectionValue())</string> </value> <value> <string>python: object.Base_isPublicConvertionResult() and (lambda x: x is not None and not (len(x.getAvailableLanguageSet()) == 1 or x.getStaticLanguageSelection()))(object.getWebSectionValue())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1433,7 +1553,7 @@ ...@@ -1433,7 +1553,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: getattr(object, \'Base_getWebDocumentDrivenModificationDate\', object.modified)()</string> </value> <value> <string>python: getattr(object, \'getModificationDate\', object.modified)()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1446,7 +1566,7 @@ ...@@ -1446,7 +1566,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: member is None and (lambda x: x is not None and not (len(x.getAvailableLanguageSet()) == 1 or x.getStaticLanguageSelection()))(object.getWebSectionValue())</string> </value> <value> <string>python: object.Base_isPublicConvertionResult() and (lambda x: x is not None and (len(x.getAvailableLanguageSet()) == 1 or x.getStaticLanguageSelection()))(object.getWebSectionValue())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -1478,6 +1598,45 @@ ...@@ -1478,6 +1598,45 @@
</pickle> </pickle>
</record> </record>
<record id="32" aka="AAAAAAAAACA="> <record id="32" aka="AAAAAAAAACA=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: member is None and (lambda x: x is not None and not (len(x.getAvailableLanguageSet()) == 1 or x.getStaticLanguageSelection()))(object.getWebSectionValue())</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="33" aka="AAAAAAAAACE=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="34" aka="AAAAAAAAACI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: getattr(object, \'Base_getWebDocumentDrivenModificationDate\', object.modified)()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="35" aka="AAAAAAAAACM=">
<pickle> <pickle>
<global name="Expression" module="Products.CMFCore.Expression"/> <global name="Expression" module="Products.CMFCore.Expression"/>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment