Commit d2b35fbf authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web: add hateoas caching policy

parent 20a7fdb8
...@@ -788,10 +788,6 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -788,10 +788,6 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
if is_site_root:\n if is_site_root:\n
\n \n
result_dict[\'default_view\'] = \'view\'\n result_dict[\'default_view\'] = \'view\'\n
# XXX Hardcoded cache for 30 minutes. Should only bother developers but speed up Jio access\n
response.setHeader("Cache-Control", "public, max-age=1800")\n
response.setHeader("Vary", "Cookie")\n
response.setHeader("Last-Modified", DateTime().rfc822())\n
REQUEST.set("X-HATEOAS-CACHE", 1)\n REQUEST.set("X-HATEOAS-CACHE", 1)\n
\n \n
# Global action users for the jIO plugin\n # Global action users for the jIO plugin\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>caching_policy/hateoas</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>hateoas</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Hateoas</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
<value> <value>
<tuple> <tuple>
<string>aggregate/web_page_module/rjs_gadget_erp5_html</string> <string>aggregate/web_page_module/rjs_gadget_erp5_html</string>
<string>caching_policy/hateoas</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -483,7 +484,7 @@ ...@@ -483,7 +484,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>941.35235.58430.32802</string> </value> <value> <string>944.53459.40487.3686</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -501,8 +502,8 @@ ...@@ -501,8 +502,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1425895920.4</float> <float>1439219895.9</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
...@@ -147,6 +147,14 @@ ...@@ -147,6 +147,14 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>caching_policy/hateoas</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>container_layout</string> </key> <key> <string>container_layout</string> </key>
<value> <string>ERP5Document_getHateoas</string> </value> <value> <string>ERP5Document_getHateoas</string> </value>
......
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