Skip to content

Commit 090e0fd

Browse files
committed
Disable the cache if debug=True.
1 parent 54ca4a3 commit 090e0fd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dash/dash.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,4 +760,15 @@ def run_server(self,
760760
port=8050,
761761
debug=False,
762762
**flask_run_options):
763+
764+
if debug:
765+
# Disable the cache
766+
# pylint: disable=unused-variable
767+
@self.server.after_request
768+
def after_req(rep):
769+
rep.headers['Cache-Control'] = 'no-cache,' \
770+
' no-store,' \
771+
' must-revalidate'
772+
return rep
773+
763774
self.server.run(port=port, debug=debug, **flask_run_options)

0 commit comments

Comments
 (0)