Files
kashilo/.htaccess

43 lines
1.4 KiB
ApacheConf

<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>