Skip to content
Web and HTTP2 min read

What are Gzip and Brotli compression?

Short answer

Gzip and Brotli are compression algorithms a web server uses to shrink text files such as HTML, CSS and JavaScript before sending them; the browser decompresses them automatically. The files get much smaller and arrive faster, and Brotli compresses text a little better than Gzip and is supported by modern browsers.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. How it works
  2. Example: check your site
  3. Comparison
  4. What not to compress
  5. Common problems
  6. On ArabyHost

Web text files are full of repetition: the same tags and function names appear hundreds of times, and compression exploits that. Visitors don’t have to do anything; it’s an automatic negotiation between browser and server through HTTP headers.

How it works

  1. The browser sends Accept-Encoding: gzip, deflate, br with its request.
  2. The server picks a method both sides support and compresses the file.
  3. It replies with Content-Encoding: br or gzip and the compressed file.
  4. The browser decompresses it and renders the page.

Example: check your site

curl -sI -H 'Accept-Encoding: br, gzip' https://example.com | grep -i content-encoding
# content-encoding: br

If nothing prints, the file is sent uncompressed. You can also compare transferred size with actual size in the Network tab of your browser’s developer tools.

Comparison

Gzip Brotli
Introduced 1990s 2015, by Google
Compression ratio Good Slightly better for text
Support Every browser and tool Modern browsers over HTTPS
Speed Fast to compress Slower at high levels, so static files are pre-compressed

What not to compress

  • Images, video and WOFF2 fonts are already compressed; doing it again wastes CPU for no gain. To shrink them, see the image optimisation guide.
  • Very small files, where the saving isn’t worth it.

Common problems

  • Double compression: a WordPress plugin compresses and the server compresses again, producing garbled characters or a blank page. Compress in one place only.
  • A speed test says compression is off: it may be flagging a file from an external domain you don’t control, such as an ad script or web fonts.
  • Compression doesn’t fix a slow server: it shortens transfer time, while the time to generate the page shows up in TTFB.

On ArabyHost

The LiteSpeed web server that ArabyHost runs supports both Gzip and Brotli, and on WordPress sites the LiteSpeed Cache plugin works directly with the server, so you usually don’t need a separate compression plugin that could cause double compression. Use the check above to confirm the result on your own site, and read the website speed guide for steps that improve your Core Web Vitals.

FAQ

Do I need a compression plugin in WordPress?

Usually not, if the web server already compresses files. Check first with developer tools or curl; if `content-encoding` shows up, skip the plugin, since it can cause double compression.

Which is better, Gzip or Brotli?

Brotli produces slightly smaller text files and the browser uses it automatically when both sides support it. Gzip still matters for older tools and browsers, so servers enable both.

Does Gzip help with images?

No. JPEG, PNG and WebP are already compressed, and compressing them again barely changes their size. To shrink images, change their format, dimensions or quality.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.