perf: lighthouse optimizations - inline critical CSS, lazy-load routes, WebP images, fix CLS and contrast

This commit is contained in:
2026-02-08 11:22:36 +01:00
parent 013d591e75
commit c66c80adcc
23 changed files with 448 additions and 101 deletions

42
.htaccess Normal file
View File

@@ -0,0 +1,42 @@
<IfModule mod_expires.c>
ExpiresActive On
# Fonts (1 year - they never change)
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType application/font-woff2 "access plus 1 year"
# Images (1 year)
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# CSS & JS (1 week - updated via deploy)
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
# JSON (1 day - locales may change)
ExpiresByType application/json "access plus 1 day"
# HTML (no cache - always fresh)
ExpiresByType text/html "access plus 0 seconds"
# Manifest & Service Worker (no cache)
<FilesMatch "(manifest\.json|service-worker\.js)$">
ExpiresDefault "access plus 0 seconds"
</FilesMatch>
</IfModule>
<IfModule mod_headers.c>
# Service Worker must not be cached
<FilesMatch "service-worker\.js$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
</FilesMatch>
# Fonts: immutable
<FilesMatch "\.(woff2|woff)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
</IfModule>