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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
91667964
Commit
91667964
authored
Jul 31, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: return modification date in precache json dict script response
parent
4cb13be9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
...skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
+5
-12
No files found.
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
View file @
91667964
web_section
=
context
web_section
=
context
if
REQUEST
is
not
None
:
modification_date_string
=
web_section
.
getModificationDate
().
rfc822
()
weak_etag_header
=
'W/"%s"'
%
modification_date_string
REQUEST
.
RESPONSE
.
setHeader
(
'ETag'
,
weak_etag_header
)
if_none_match
=
REQUEST
.
getHeader
(
'If-None-Match'
,
''
)
#using 'in' instead of '==' because the header value may contain a suffix
#for the server HTTP compression. e.g. "-gzip" suffix for DeflateAlterETag on apache
if
weak_etag_header
[:
-
1
]
in
if_none_match
:
REQUEST
.
RESPONSE
.
setStatus
(
304
)
return
""
# Add all ERP5JS gadget
# Add all ERP5JS gadget
url_list
=
[
url_list
=
[
'favicon.ico'
,
'favicon.ico'
,
...
@@ -197,7 +186,11 @@ for precache_manifest_script_id in precache_manifest_url_list:
...
@@ -197,7 +186,11 @@ for precache_manifest_script_id in precache_manifest_url_list:
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
import
json
import
json
manifest_dict
=
{
'url_dict'
:
dict
.
fromkeys
(
url_list
),
'modification_date'
:
context
.
getModificationDate
().
rfc822
()
}
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'application/json'
)
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'application/json'
)
return
json
.
dumps
(
dict
.
fromkeys
(
url_list
)
,
indent
=
2
)
return
json
.
dumps
(
manifest_dict
,
indent
=
2
)
return
list
(
set
(
url_list
))
return
list
(
set
(
url_list
))
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