Linux, Web Server & Database
Enable Brotli Compression
Enable Brotli compression on your web server for better compression ratios than GZIP.
The Problem
Your site is only using GZIP (or no compression at all), missing out on Brotli's typically better compression ratios for the same text-based content, which translates to faster loads for the same visitor experience.
About this problem
Brotli is a newer compression algorithm developed by Google that generally achieves smaller output than GZIP for the same HTML, CSS and JavaScript content, at the cost of needing a specific server module that isn't always installed by default the way GZIP is.
This typically comes up for sites chasing every available performance improvement, often alongside a broader page-speed optimisation push.
What's Included
- Installing the Brotli module for your specific web server if not already present
- Configuring Brotli compression for appropriate text-based file types
- Setting a sensible compression level for your server's resources
- Confirming compression is genuinely active with a real test, with GZIP kept as a fallback for older clients
What's NOT Included
- Removing GZIP entirely (Brotli works best alongside it as a fallback for clients that don't support Brotli)
- CDN-level Brotli configuration if you're using a CDN that handles this separately
- Application-level response optimisation beyond server-level compression
How It Works
- Check whether the Brotli module is already available for your web server, installing it if not.
- Enable Brotli compression and configure which MIME types it applies to, matching the GZIP configuration.
- Set an appropriate quality/compression level, balancing CPU use against compression ratio.
- Keep GZIP configured as a fallback for any client that doesn't support Brotli.
- Test with a real request and check the Content-Encoding: br header to confirm Brotli is being served to supporting clients.
In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.
Frequently Asked Questions
- Is Brotli better than GZIP?
- Generally yes for compression ratio on the same content, often producing noticeably smaller files, though it requires a specific server module and slightly more CPU to compress at higher quality levels.
- Do all browsers support Brotli?
- Nearly all modern browsers do, but as a safety net GZIP is kept configured as a fallback for anything that doesn't advertise Brotli support.
- Will enabling Brotli replace my current GZIP setup?
- Not necessarily — the best setup serves Brotli to clients that support it and automatically falls back to GZIP for the rest, rather than removing GZIP entirely.
- How do I check if Brotli is actually working on my site?
- Checking the response headers for Content-Encoding: br (rather than gzip) on a supporting browser confirms Brotli is being served.
- Does Brotli need a separate module installed?
- Yes, most web servers don't bundle Brotli support by default the way they do GZIP, so an additional module usually needs installing first.
- Is Brotli compression noticeably slower to generate than GZIP?
- At higher quality levels it can use more CPU than GZIP for the same content, which is why the compression level is tuned to balance file size savings against server load.