favicons
This commit is contained in:
@@ -110,9 +110,12 @@ def create_app() -> Flask:
|
||||
|
||||
static_file = request.path.startswith("/static/")
|
||||
tracker_icon = request.path.startswith("/static/tracker_favicons/")
|
||||
favicon_ico = request.path == "/favicon.ico"
|
||||
|
||||
if static_file and not tracker_icon:
|
||||
response.headers["Cache-Control"] = "public, max-age=31536000, immutable"
|
||||
elif favicon_ico:
|
||||
response.headers["Cache-Control"] = "public, max-age=86400"
|
||||
else:
|
||||
response.headers["Cache-Control"] = "no-store, private"
|
||||
|
||||
|
||||
@@ -22,9 +22,7 @@ def favicon_ico():
|
||||
current_app.static_folder,
|
||||
"favicon.svg",
|
||||
mimetype="image/svg+xml",
|
||||
max_age=86400,
|
||||
)
|
||||
response.headers["Cache-Control"] = "public, max-age=86400"
|
||||
return response
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user