Brotli Support

Brotli Support

The Sucuri Firewall compresses your website’s responses with Brotli and gzip, so pages load faster and use less bandwidth. You don’t need to enable Brotli on your hosting server.

How it works

For every request, the firewall checks the Accept-Encoding header the visitor’s browser sends and picks the best compression it supports.

Browser supports:

Firewall sends:

Brotli (br), as all modern browsers do

Brotli (Content-Encoding: br), usually 15–20% smaller than gzip

gzip only

gzip (Content-Encoding: gzip)

No compression

Uncompressed content

  • It works on every caching level and for every request, cached or not.

  • Compressed: HTML pages, CSS, JavaScript, JSON, XML, RSS/Atom feeds, SVG, icons and web fonts (.ttf, .otf, .eot).

  • Not compressed: files that are already compressed, such as JPEG, PNG, WebP, AVIF, video, PDF, ZIP and WOFF/WOFF2 fonts. Compressing them again saves nothing.
    Small responses (under 1 KB) aren’t compressed.

  • The firewall adds Vary: Accept-Encoding, so browsers and other caches keep the compressed and uncompressed versions apart.

Do I need to change anything on my server?

No. You can leave compression on or off on your server; the firewall handles compression for your visitors in both cases. For cached content, it stores an uncompressed copy and compresses it for each visitor, so a visitor never receives encoded content that their browser doesn’t support.

How to check

Run the following curl request:

curl -s -o /dev/null -D - -H 'Accept-Encoding: br, gzip' https://yourdomain.com/

Look for the content-encoding header in the response.
Your browser’s Developer Tools will show the same in the Network tab. Select a request and look at the content-encoding response header.

Was this article helpful?