From f86e870ff012ac1fc7122b75109fc0e9e3a76f2f Mon Sep 17 00:00:00 2001 From: Maciej Pienczyn Date: Tue, 7 Apr 2026 18:00:21 +0200 Subject: [PATCH] perf+a11y: heading order, image dimensions, static cache headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix heading hierarchy: H4→H3 in "Dlaczego warto?" section (6 cards) to maintain sequential H1→H2→H3 order (accessibility) - Add explicit width/height to logo images in header/footer (CLS) - Add Cache-Control: 30 days for /static/ assets (performance) Co-Authored-By: Claude Opus 4.6 (1M context) --- app.py | 4 ++++ templates/base.html | 6 +++--- templates/landing.html | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 76fe05f..39f8f90 100644 --- a/app.py +++ b/app.py @@ -793,6 +793,10 @@ def set_security_headers(response): response.headers['Referrer-Policy'] = 'strict-origin-when-cross-origin' response.headers['Permissions-Policy'] = 'camera=(), microphone=(), geolocation=(self)' + # Cache static assets (CSS, JS, images, fonts) + if request.path.startswith('/static/'): + response.headers['Cache-Control'] = 'public, max-age=2592000' # 30 days + # Freshness signal for SEO crawlers if response.content_type and 'text/html' in response.content_type and 'Last-Modified' not in response.headers: from email.utils import formatdate diff --git a/templates/base.html b/templates/base.html index bfd59ab..0bdbe56 100755 --- a/templates/base.html +++ b/templates/base.html @@ -1544,7 +1544,7 @@