diff --git a/public/.htaccess b/public/.htaccess index 3aec5e27..fc75c038 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -19,3 +19,36 @@ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] + +# Enable Brotli compression with priority over gzip + + AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json application/xml application/rss+xml application/font-woff application/font-woff2 + # Force Brotli compression if available + SetEnvIf Accept-Encoding br brotli + + +# Enable gzip compression only if Brotli is unavailable + + + AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json application/xml application/rss+xml application/font-woff application/font-woff2 + + + +# This configuration allows browsers to cache assets locally + + + + Header set Cache-Control "public, max-age=31536000, immutable" + Header set Pragma "public" + Header unset ETag + FileETag None + Header unset Last-Modified + + + + # Security headers + Header set X-Frame-Options "SAMEORIGIN" + Header set X-Content-Type-Options "nosniff" + Header set X-XSS-Protection "1; mode=block" + Header set Strict-Transport-Security "max-age=31536000; includeSubDomains" env=HTTPS +