prevent cached responses
This commit is contained in:
13
app.py
13
app.py
@@ -32,6 +32,19 @@ item6 = 0
|
||||
|
||||
app.logger.info('Starting erdbeerhannah v' + version)
|
||||
|
||||
# prevent cached responses
|
||||
@app.after_request
|
||||
def add_header(r):
|
||||
"""
|
||||
Add headers to both force latest IE rendering engine or Chrome Frame,
|
||||
and also to cache the rendered page for 10 minutes.
|
||||
"""
|
||||
r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
|
||||
r.headers["Pragma"] = "no-cache"
|
||||
r.headers["Expires"] = "0"
|
||||
r.headers['Cache-Control'] = 'public, max-age=0'
|
||||
return r
|
||||
|
||||
@app.route("/", methods=["GET", "POST"])
|
||||
def index():
|
||||
global gesamtwert, item1, item2, item3, item4, item5, item6, sum, givenfloat, change, given, background, postcounter, version
|
||||
|
Reference in New Issue
Block a user