Use immutable cache for HTML5 assets
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 12:59:41 +03:00
parent faf1bbd10a
commit 1ad103b6dc
2 changed files with 10 additions and 4 deletions
@@ -20,7 +20,7 @@ HTML5_CONTENT_SECURITY_POLICY = (
class Html5StaticFiles(StaticFiles):
def file_response(self, *args, **kwargs):
response = super().file_response(*args, **kwargs)
response.headers.setdefault("Cache-Control", "public, max-age=86400")
response.headers.setdefault("Cache-Control", "public, max-age=31536000, immutable")
response.headers.setdefault("X-Content-Type-Options", "nosniff")
return response