Skip to content
GitLab
Explore
Sign in
"templates/git@esc-md-git.unil.ch:ICNML/web.git" did not exist on "c2680e0c9ea6669de2e27151970b88c2dc5b66e6"
Commits on Source (1)
Add the headers to disable the client-side cache
· ec0c77a8
Marco De Donno
authored
Oct 21, 2019
ec0c77a8
Hide whitespace changes
Inline
Side-by-side
module.py
View file @
ec0c77a8
...
@@ -28,6 +28,7 @@ from flask_compress import Compress
...
@@ -28,6 +28,7 @@ from flask_compress import Compress
from
flask_session
import
Session
from
flask_session
import
Session
from
pyzbar
import
pyzbar
from
pyzbar
import
pyzbar
from
werkzeug
import
abort
,
redirect
from
werkzeug
import
abort
,
redirect
from
werkzeug.http
import
http_date
from
werkzeug.middleware.proxy_fix
import
ProxyFix
from
werkzeug.middleware.proxy_fix
import
ProxyFix
import
gnupg
import
gnupg
import
pdf2image
import
pdf2image
...
@@ -268,6 +269,17 @@ def send_static_files( subpath ):
...
@@ -268,6 +269,17 @@ def send_static_files( subpath ):
"""
"""
return
send_from_directory
(
"
static
"
,
subpath
)
return
send_from_directory
(
"
static
"
,
subpath
)
################################################################################
# Headers
@app.after_request
def
add_header
(
r
):
r
.
headers
[
"
Last-Modified
"
]
=
http_date
(
datetime
.
now
()
)
r
.
headers
[
"
Cache-Control
"
]
=
"
no-cache, no-store, must-revalidate, max-age=0
"
r
.
headers
[
"
Pragma
"
]
=
"
no-cache
"
r
.
headers
[
"
Expires
"
]
=
"
0
"
return
r
################################################################################
################################################################################
# Sessions
# Sessions
...
...