Short answer: Gzip and Brotli compress HTML, CSS and JavaScript before sending them, often cutting their size by 70% or more. Brotli usually compresses text smaller than Gzip and is supported by modern browsers over HTTPS. Most good hosts enable one or both automatically.
What gets compressed
Text files: HTML, CSS, JavaScript, JSON and SVG. Images such as JPEG and WebP are already compressed, so compressing them again doesn't help.
Gzip vs Brotli
| Gzip | Brotli | |
|---|---|---|
| Support | Universal | All modern browsers (over HTTPS) |
| Size | Good | Usually smaller for text |
| Server cost | Low | Low at normal levels |
How to check
Open your browser's developer tools, reload the page and look at the Content-Encoding header for your HTML: br means Brotli, gzip means Gzip.
Turning it on
- On LiteSpeed and many cPanel servers, compression is on by default.
- On Apache, mod_deflate (Gzip) can be enabled in .htaccess. See .htaccess basics.
- Many CDNs add Brotli automatically. See what a CDN is.
Frequently asked questions
Does compression help on mobile?
Yes. Smaller files download faster on slower connections. See website speed in Africa.
Can compression break my site?
Very rarely. Check that pages and downloads still work after enabling it.



