Skip to content

Commit

Permalink
Disable the cache if debug=True.
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed Jul 31, 2018
1 parent 54ca4a3 commit 090e0fd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,4 +760,15 @@ def run_server(self,
port=8050,
debug=False,
**flask_run_options):

if debug:
# Disable the cache
# pylint: disable=unused-variable
@self.server.after_request
def after_req(rep):
rep.headers['Cache-Control'] = 'no-cache,' \
' no-store,' \
' must-revalidate'
return rep

self.server.run(port=port, debug=debug, **flask_run_options)

0 comments on commit 090e0fd

Please sign in to comment.