What is gzip or Brotli compression for websites?

Gzip and Brotli are ways for a server to squeeze text files before sending them, so the browser downloads far less and expands the file on arrival. The page itself, its scripts and its stylesheets are all text, and they typically shrink by around seventy per cent. It is a single server setting that makes every page on the site faster.

Why it matters

A typical page's HTML, CSS and JavaScript might total 600 KB uncompressed and 180 KB compressed. On a mobile connection that difference is the gap between a page that appears in a second and one that takes three. Because compression applies to the files the browser needs first, before it can draw anything, the saving is felt at the moment that matters most.

Gzip or Brotli?

Brotli is newer and compresses text around fifteen to twenty per cent better than gzip. Every modern browser supports both. Servers usually offer gzip by default and Brotli as an option; either is far better than nothing. Images and video are already compressed and gain nothing from this, so it is normal for them to be sent as they are.

How to check

Our check looks at the Content-Encoding header on your home page. If it says gzip or br, compression is on. You can see the same header in a browser's developer tools under the Network tab.

How to fix it

Ask your host to enable gzip or Brotli. On most hosting control panels it is a tick box, and on Apache it is a few lines in the .htaccess file. If your site sits behind a content delivery network such as Cloudflare, compression is usually on already. Many WordPress caching plugins also offer it as a setting.

Not sure how your own site does on this? Run the free check: it takes about twenty seconds and reports on this and thirty other things.

Check my website

More guides