Skip to content

Commit

Permalink
Disable caching for API
Browse files Browse the repository at this point in the history
  • Loading branch information
gfrogat committed Dec 6, 2018
1 parent ee669ea commit 4492e1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions confusionflow/server/blueprints/api.py
Expand Up @@ -23,6 +23,16 @@ def record_logdir(setup_state):
logdir = config["LOGDIR"]


# TODO update to ETag
@bp.after_request
def set_response_headers(response):
"""Disables caching."""
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate, max-age=0"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "0"
return response


@bp.route("/")
def api_hello():
return "Welcome to ConfusionFlow API"
Expand Down

0 comments on commit 4492e1e

Please sign in to comment.