Last active
January 22, 2018 06:14
-
-
Save danielrichman/3579741de3af404a73bc to your computer and use it in GitHub Desktop.
flask no-cache headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there, im a newbie to python framework, so can you show me a small example code how to implement this