1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 09:30:01 +00:00

Forbid caching when debugging

This commit is contained in:
TheAMM 2017-05-27 21:33:20 +03:00
parent d65602ee9f
commit 260dc2cdc8

View file

@ -22,6 +22,15 @@ if app.config['DEBUG']:
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
toolbar = DebugToolbarExtension(app)
app.logger.setLevel(logging.DEBUG)
# Forbid caching
@app.after_request
def forbid_cache(request):
request.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate, max-age=0'
request.headers['Pragma'] = 'no-cache'
request.headers['Expires'] = '0'
return request
else:
app.logger.setLevel(logging.WARNING)