Skip to content

Instantly share code, notes, and snippets.

@danielrichman
Last active January 22, 2018 06:14
Show Gist options
  • Select an option

  • Save danielrichman/3579741de3af404a73bc to your computer and use it in GitHub Desktop.

Select an option

Save danielrichman/3579741de3af404a73bc to your computer and use it in GitHub Desktop.
flask no-cache headers
@app.after_request
def add_no_cache(response):
if request.endpoint != "static":
response.headers[b"Cache-Control"] = "no-cache"
response.headers[b"Pragma"] = "no-cache"
return response
@mohammedabbas27
Copy link
Copy Markdown

Hi there, im a newbie to python framework, so can you show me a small example code how to implement this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment