From bbef96bda11e7aaf3c1a8b7213b4c2d6c4f34ec7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 23 Aug 2021 12:14:59 +0200 Subject: [PATCH] fdfd --- files/routes/static.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/routes/static.py b/files/routes/static.py index 1c7e57ee2..9f14e45e1 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -134,8 +134,11 @@ def archives(path): @limiter.exempt def static_service(path): resp = make_response(send_from_directory('./assets', path)) - if request.path.endswith('.css'): resp.headers.add("Content-Type", "text/css") - if request.path.endswith('.gif') or request.path.endswith('.ttf') or request.path.endswith('.woff') or request.path.endswith('.woff2'): + if request.path.endswith('.css'): + resp.headers.add("Content-Type", "text/css") + resp.headers.remove("Cache-Control") + resp.headers.add("Cache-Control", "public, max-age=86400") + elif request.path.endswith('.gif') or request.path.endswith('.png') or request.path.endswith('.ttf') or request.path.endswith('.woff') or request.path.endswith('.woff2'): resp.headers.remove("Cache-Control") resp.headers.add("Cache-Control", "public, max-age=31556952")