How can I enable Brotli compression in Apache for better Core Web Vitals scores?
Asked on Sep 12, 2025
Answer
Enabling Brotli compression in Apache can significantly improve your site's Core Web Vitals by reducing the size of your transferred files, thus enhancing loading speed. Here's how you can configure Brotli compression in your Apache server.
<!-- BEGIN COPY / PASTE -->
LoadModule brotli_module modules/mod_brotli.so
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css
AddOutputFilterByType BROTLI_COMPRESS application/javascript application/json
AddOutputFilterByType BROTLI_COMPRESS application/x-font-ttf application/vnd.ms-fontobject
AddOutputFilterByType BROTLI_COMPRESS image/svg+xml application/xml
</IfModule>
<!-- END COPY / PASTE -->Additional Comment:
- Ensure that the mod_brotli module is installed and enabled on your Apache server.
- Brotli compression is generally more efficient than Gzip, especially for text-based files.
- Test your site after enabling Brotli to ensure compatibility and performance gains.
- Check your server's configuration files (e.g., httpd.conf or .htaccess) to apply these settings.
- Use online tools or browser developer tools to verify that Brotli compression is active.
Recommended Links: