Commit 628be95d authored by Romain Courteaud's avatar Romain Courteaud Committed by Sebastien Robin

Hardcode some cache to speed up Jio access.

caching_policy_manager configuration has to be modified to make it effective
parent 771da240
......@@ -57,6 +57,7 @@ from AccessControl import getSecurityManager\n
from ZTUtils import make_query\n
from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery\n
import json\n
from DateTime import DateTime\n
if REQUEST is None:\n
REQUEST = context.REQUEST\n
# raise Unauthorized\n
......@@ -514,6 +515,12 @@ elif (mode == \'root\') or (mode == \'traverse\'):\n
# XXX Custom slapos code\n
##############\n
if is_site_root:\n
\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
\n
# Global action users for the jIO plugin\n
# XXX Would be better to not hardcode them but put them as portal type\n
# "actions" (search could be on portal_catalog document, traverse on all\n
......@@ -698,6 +705,10 @@ elif mode == \'form\':\n
if REQUEST.other[\'method\'] != "GET":\n
response.setStatus(405)\n
return ""\n
\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
\n
renderForm(form, result_dict)\n
\n
......
20
\ No newline at end of file
21
\ No newline at end of file
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