πŸ“„
Webhosting

Setting Up Gzip and Brotli Compression for a Faster Site

πŸ“… 7 October 2026 ✏️ 7 October 2026 ⏱ 4 min leestijd

Want to make your website faster with gzip or Brotli compression? Read how it works, what the difference is, and how to activate it on your hosting.

A slow website costs you visitors and conversions, and one of the easiest wins lies in compressing your files. Gzip and Brotli shrink HTML, CSS, and JavaScript before they’re sent to the browser, allowing pages to load faster without you having to change anything about your design. In this article, you’ll learn the difference between the two techniques, how to activate them, and how to check whether it’s working.

What is gzip and Brotli compression

Gzip and Brotli are compression algorithms that shrink text files such as HTML, CSS, JavaScript, and SVG before the server sends them. Your visitor’s browser then automatically unpacks the file again. Because the file is smaller in transit, your page loads faster, especially on a slow internet connection or mobile network.

Images such as JPG and PNG barely benefit from this, since they’re already compressed. The gains mainly come from the “textual” parts of your website: the code behind the page.

ServerCompressionBrowser

Files are sent compressed and unpacked again by the browser.

Brotli vs gzip: which is faster

Brotli is a newer compression method that generally produces smaller files than gzip, with comparable or sometimes even lower server load. Nearly all modern browsers now support Brotli. Gzip has been supported for much longer and is therefore still a solid fallback for older browsers or software that doesn’t understand Brotli.

In practice, it’s best to enable both: the server then automatically chooses the method supported by the visitor’s browser. This is called “content negotiation” and happens via the HTTP header sent along by the browser.

πŸ’‘ Tip: If your website runs on a LiteSpeed server, Brotli is often already supported by default without you having to install anything yourself.

Activating compression on your hosting

How you enable gzip or Brotli depends on your server software. Below are the most common methods.

1

Check your server software

Check under your hosting settings in Plesk which webserver you’re using: Apache, Nginx, or LiteSpeed. This determines where you’ll find the setting.

2

Via .htaccess (Apache)

Add the mod_deflate or mod_brotli directives to your .htaccess file. Many hosting panels, including Plesk, also offer this as a configurable option in the server configuration, so you don’t have to tinker manually.

3

Via caching plugin (WordPress)

If you use WordPress, you can often also arrange compression through a caching plugin. Be careful not to enable two methods at the same time, as this can actually cause errors.

4

Enable server-wide

If you have access to server settings, it’s more efficient to activate compression server-wide instead of per website. This way, every site on the account benefits, including new domains you add later.

At Tandata, web hosting runs on LiteSpeed servers by default, with compression settings manageable from Plesk without needing to manually edit server files. Check out the options at web hosting if you’re unsure whether your current package supports this.

Checking whether compression is working

After setting it up, you’ll naturally want to know whether it’s actually working. Here’s how to check:

  • Open your browser’s developer tools (usually with F12) and go to the “Network” tab.
  • Reload your page and click on the main file (usually the HTML document).
  • Check the response headers for content-encoding. If it says “br” or “gzip”, compression is working.
  • Also compare the file size: a compressed file is noticeably smaller than the original size.

If you don’t see a content-encoding header, check whether the correct module is active on your server or whether a plugin is overriding the setting.

Frequently Asked Questions

Does compression make my website slower due to the extra processing step?

No, compressing takes the server a fraction of a second, while you save on transmission time. With normal visitor numbers, you won’t notice this difference.

Should I disable gzip if I use Brotli?

No, keep both active. The server automatically chooses the best option based on what the visitor’s browser supports.

Does compression also work for images?

Not effectively. JPG, PNG, and WebP are already compressed. For images, it’s better to focus on the right format and file size beforehand.

Can compression make a website appear slower due to error messages?

If compression is configured incorrectly, a page may sometimes not load at all or show an error message. In that case, check whether duplicate compression settings are active, for example via both the server and a plugin.

Conclusion

Gzip and especially Brotli compression are simple, effective ways to make your website noticeably faster. Check which server software you’re using, enable both methods wherever possible, and verify via the browser that compression is actually active. If you’re unsure about the settings on your current hosting, check out the knowledge base for more explanation per situation.

View web hosting β†’

Was dit artikel nuttig?