fix: no-cache заголовки (Cache-Control, Pragma, Expires) — F5 больше не кэширует
Deploy drhider / validate (push) Waiting to run
Deploy drhider / validate (push) Waiting to run
This commit is contained in:
+9
-1
@@ -20,7 +20,7 @@ if _sys_path_root not in sys.path:
|
||||
sys.path.insert(0, _sys_path_root)
|
||||
|
||||
# Версия приложения (меняется при изменениях)
|
||||
VERSION = "3.2.3"
|
||||
VERSION = "3.2.4"
|
||||
|
||||
|
||||
def create_app():
|
||||
@@ -45,6 +45,14 @@ def create_app():
|
||||
|
||||
register_routes(app)
|
||||
|
||||
# Запрещаем кэширование — F5 всегда грузит свежую страницу
|
||||
@app.after_request
|
||||
def no_cache(response):
|
||||
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
|
||||
response.headers["Pragma"] = "no-cache"
|
||||
response.headers["Expires"] = "0"
|
||||
return response
|
||||
|
||||
return app
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user