Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bryan Kaperick
erp5
Commits
2a61965a
Commit
2a61965a
authored
Jul 28, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support 'Cache-Control: public' in Accelerated HTTP Cache Manager.
parent
12366b5d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
1 deletion
+42
-1
product/ERP5/bootstrap/erp5_xhtml_style/PathTemplateItem/anonymous_http_cache.xml
...rp5_xhtml_style/PathTemplateItem/anonymous_http_cache.xml
+12
-0
product/ERP5/bootstrap/erp5_xhtml_style/PathTemplateItem/http_cache.xml
...ootstrap/erp5_xhtml_style/PathTemplateItem/http_cache.xml
+12
-0
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+1
-1
product/ERP5Type/dtml/propsAccel.dtml
product/ERP5Type/dtml/propsAccel.dtml
+11
-0
product/ERP5Type/patches/AcceleratedHTTPCacheManager.py
product/ERP5Type/patches/AcceleratedHTTPCacheManager.py
+6
-0
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/PathTemplateItem/anonymous_http_cache.xml
View file @
2a61965a
...
...
@@ -28,6 +28,18 @@
<tuple/>
</value>
</item>
<item>
<key>
<string>
public
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
stale_if_error_interval
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
stale_while_revalidate_interval
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</value>
</item>
...
...
product/ERP5/bootstrap/erp5_xhtml_style/PathTemplateItem/http_cache.xml
View file @
2a61965a
...
...
@@ -28,6 +28,18 @@
<tuple/>
</value>
</item>
<item>
<key>
<string>
public
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
stale_if_error_interval
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
stale_while_revalidate_interval
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</value>
</item>
...
...
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
View file @
2a61965a
1118
\ No newline at end of file
1119
\ No newline at end of file
product/ERP5Type/dtml/propsAccel.dtml
View file @
2a61965a
...
...
@@ -48,6 +48,17 @@
value="&dtml-stale_while_revalidate_interval;" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Public?
</div>
</td>
<td align="left" valign="top">
<input type="checkbox" name="public" value="1"<dtml-if
public> checked="checked"</dtml-if> />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
...
...
product/ERP5Type/patches/AcceleratedHTTPCacheManager.py
View file @
2a61965a
...
...
@@ -40,6 +40,8 @@ def ZCache_set(self, ob, data, view_name, keywords, mtime_func):
if
getattr
(
self
,
'stale_while_revalidate_interval'
,
0
):
cache_control_parameter
.
append
(
"stale-while-revalidate=%d"
\
%
(
self
.
stale_while_revalidate_interval
))
if
getattr
(
self
,
'public'
,
0
):
cache_control_parameter
.
append
(
'public'
)
RESPONSE
.
setHeader
(
'Last-Modified'
,
rfc1123_date
(
time
.
time
()))
RESPONSE
.
setHeader
(
'Cache-Control'
,
", "
.
join
(
cache_control_parameter
))
RESPONSE
.
setHeader
(
'Expires'
,
expires
)
...
...
@@ -56,6 +58,7 @@ def __init__(self, ob_id):
'interval'
:
3600
,
'stale_if_error_interval'
:
300
,
'stale_while_revalidate'
:
10
,
'public'
:
1
,
'notify_urls'
:
()}
self
.
_resetCacheId
()
...
...
@@ -69,6 +72,7 @@ def manage_editProps(self, title, settings=None, REQUEST=None):
'interval'
:
int
(
settings
[
'interval'
]),
'stale_if_error_interval'
:
int
(
settings
[
'stale_if_error_interval'
]),
'stale_while_revalidate_interval'
:
int
(
settings
[
'stale_while_revalidate_interval'
]),
'public'
:
settings
.
get
(
'public'
)
and
1
or
0
,
'notify_urls'
:
tuple
(
settings
[
'notify_urls'
])}
cache
=
self
.
ZCacheManager_getCache
()
cache
.
initSettings
(
self
.
_settings
)
...
...
@@ -84,6 +88,8 @@ def getSettings(self):
self
.
_settings
.
update
({
'stale_if_error_interval'
:
0
})
if
'stale_while_revalidate_interval'
not
in
self
.
_settings
:
self
.
_settings
.
update
({
'stale_while_revalidate_interval'
:
0
})
if
'public'
not
in
self
.
_settings
:
self
.
_settings
.
update
({
'public'
:
0
})
return
self
.
_settings
.
copy
()
# Don't let UI modify it.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment