Brotli vs gzip vs zstd: which compression to serve and when
By TechCompare · Updated · How we check
Serve Brotli for files you compress ahead of time, Brotli or zstd for pages built on the fly, and keep gzip as the fallback. Never compress images, video or fonts that are compressed already.
Servers compress text responses like HTML, CSS, JavaScript and JSON before sending them, and the browser unpacks them. The browser lists what it accepts in its Accept-Encoding header, and the server names its pick in Content-Encoding. Gzip works everywhere. Brotli usually makes smaller files. Zstandard, or zstd, is fast enough to use on every request and often gets close to Brotli.
How this is calculated
Gzip goes back to the 1990s, and every HTTP client can read it. Brotli (RFC 7932) came out of Google in 2015 and was built for the web, with a built-in dictionary of common words and HTML snippets. Browsers only offer it over HTTPS. At its highest level it's slow to compress, so it shines for static files you compress once at build time.
Zstandard (RFC 8878) came out of Facebook. It compresses much faster than Brotli for a similar result, which suits responses built per request, like HTML from a CMS or JSON from an API. Chrome added it in version 123 and Firefox in version 126, both in 2024. Safari followed in version 26.3 in February 2026, on Apple's newest systems only. For HTTP, RFC 9659 caps the memory a zstd stream may ask a browser for.
Compression only pays off for text. JPEG, PNG, WebP, AVIF, MP4 and WOFF2 files are compressed already, and squeezing them again burns CPU for almost nothing. Tiny responses gain little either. Pages that mix a secret, like a CSRF token, with text an attacker controls can leak that secret through the compressed size, an attack called BREACH. Keep such tokens out of compressed responses or change them on every request.
The SSL Checker asks for the site's home page, or wherever it redirects, once per encoding, offering only that one each time. It reports which of br, gzip and zstd come back.
Verdict
Turn on Brotli and gzip at the least, which most CDNs do for you. Precompress static files with Brotli at a high level. For pages built per request, use Brotli at a middle level or zstd. Then check the site and confirm every encoding you enabled really comes back.
More SSL scenarios
Related guides
Frequently asked questions
Should I turn on zstd if I already have Brotli?
Why does my site send gzip when the browser supports Brotli?
Can compression break a site?
Related tools
DNS Lookup
Look up a domain's DNS records on Cloudflare or compare several resolvers at once, and read its SPF, DMARC and DKIM records in plain words.
Use toolOpen Graph Visualizer
Preview how your website links will look when shared on Google, Twitter, Facebook, and Discord.
Use toolPassword Generator
Generate secure, random passwords locally in your browser.
Use tool