Performance and monitoring

Web compression with Brotli and Gzip

Reviewed on 1 min read Brotli Gzip compression

The LiteSpeed web server automatically compresses compatible text content, such as HTML, CSS, JavaScript, JSON, XML and SVG. This reduces the data transferred; you do not need to add compression from PHP to turn it on.

The browser says which algorithms it supports and the server decides whether to deliver Brotli, Gzip or an uncompressed response depending on the resource and the configuration. Brotli can shrink some content further, but it is not always used and does not guarantee the same improvement for every file.

Check a response

In the browser's tools, open Red / Network, select the resource and look at Content-Encoding. A compressed response may show br or gzip. Check a fresh request, not only a copy from the browser's memory.

If a JPEG image, a ZIP or a very small file does not show that header, it does not mean something is wrong. The type, the size and the format's own compression all play a part. If there is a CDN, it may choose again how it delivers the resource to the visitor.

See the guide to compression and saving transfer to interpret the sizes. If you need to diagnose an incompatibility, you can temporarily disable compression for a limited scope and restore it afterwards.

You may also find useful

Something wrong or out of date? Tell us and we will review it.