This commit is contained in:
Mateusz Gruszczyński
2026-05-08 21:01:07 +02:00
parent 2409d33687
commit 6a44870985
2 changed files with 3 additions and 2 deletions

View File

@@ -110,9 +110,12 @@ def create_app() -> Flask:
static_file = request.path.startswith("/static/") static_file = request.path.startswith("/static/")
tracker_icon = request.path.startswith("/static/tracker_favicons/") tracker_icon = request.path.startswith("/static/tracker_favicons/")
favicon_ico = request.path == "/favicon.ico"
if static_file and not tracker_icon: if static_file and not tracker_icon:
response.headers["Cache-Control"] = "public, max-age=31536000, immutable" response.headers["Cache-Control"] = "public, max-age=31536000, immutable"
elif favicon_ico:
response.headers["Cache-Control"] = "public, max-age=86400"
else: else:
response.headers["Cache-Control"] = "no-store, private" response.headers["Cache-Control"] = "no-store, private"

View File

@@ -22,9 +22,7 @@ def favicon_ico():
current_app.static_folder, current_app.static_folder,
"favicon.svg", "favicon.svg",
mimetype="image/svg+xml", mimetype="image/svg+xml",
max_age=86400,
) )
response.headers["Cache-Control"] = "public, max-age=86400"
return response return response