<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 year"
    ExpiresByType application/javascript "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType image/svg+xml "access plus 1 year"
    ExpiresByType image/webp "access plus 1 year"
    ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(css|js|jpe?g|png|svg|webp|woff2)$">
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
</IfModule>

# Compress text assets before transfer. Brotli is preferred when available;
# DEFLATE remains the compatible fallback on standard cPanel Apache hosting.
<IfModule mod_brotli.c>
    AddOutputFilterByType BROTLI_COMPRESS text/css text/javascript application/javascript application/json image/svg+xml text/plain text/html
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/json image/svg+xml text/plain text/html
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(css|js|svg|json|html?)$">
        Header append Vary Accept-Encoding
    </FilesMatch>
</IfModule>
