Google announced Brotli in 2015 and published its source on GitHub; the two developers behind it had previously built Zopfli, a denser take on deflate that itself sits in the same lineage as zlib and gzip. Brotli, however, was written from scratch and aimed squarely at text assets — HTML, CSS, JavaScript and web fonts — with an early claim of a 20–26% improvement over Zopfli.

The Claim Didn't Survive Contact With CDNs

That promise never showed up in production as advertised. Some CDNs capped the compression level internally, while others only served Brotli if it had been enabled manually at the origin. Server support was decent, but reaching high compression levels meant rolling your own pre-compression or relying on a server module — often impossible on shared hosting. For a freelancer trying to squeeze out every byte while still letting clients update files on demand, that was a real obstacle.

Brotli at Full Volume

Brotli ships in multiple levels, and level 11 — Brotli:11 — is the one that meaningfully shrinks compressible files. It is also painfully slow: compressing a single minified jQuery file took several hundred milliseconds in my benchmarks, with a corresponding CPU cost.

That rules out on-demand compression. The workable approach is pre-compression combined with server-level caching, which is what I built my own performance optimization service around, grouping its features into Content, Delivery and Cache optimizations. Brotli:11 became a configurable server option so clients could decide for themselves whether the compute cost was worth it.

Maybe that’s why Pied Piper had to continue rigging its servers for more power.

The service also includes a built-in CDN, and one of its design choices was putting a public (open-source) CDN and a private CDN on a single host. That preserves the shared browser cache benefit of public resources without the separate DNS lookup and connection cost another host would add — a cost that hits mobile users hardest — and it consolidates more resources onto one host for HTTP/2 multiplexing.

With the public CDN enabled, Brotli:11 pre-compression ran across all compressible resources, including CSS, JavaScript, SVG and TTF. Compression overhead rises on the first request of each resource and then disappears. Brotli now has over 90% browser support, and nearly every request reaching the service uses it.

What It Actually Saves

Numbers came next. Recording transfer sizes for popular libraries — jQuery, Bootstrap, React and others — and comparing them against common compression methods at other CDNs showed Brotli:11 saving roughly 21%. Several of those CDNs already used Brotli, just at lower levels, which made the gap particularly satisfying. The sample is small, but the same gain appeared across every site tested.

The split of the graphical representation of the savings and the raw data below, where the savings for CSS are much more prominent than for JavaScript.

Vertical bar chart. Compares jQuery, Bootstrap, D3.js, Ant Design, Senamtic UI, Font Awesome, React, Three.js, Bulma and Vue before and after Brotli compression. Brotli compression is always smaller.
LibraryOriginalAvg. of Common Compression (A)Brotli:11 (B)(A) / (B) – 1
Ant Design1,938.99 KB438.24 KB362.82 KB20.79%
Bootstrap152.11 KB24.20 KB17.30 KB39.88%
Bulma186.13 KB23.40 KB19.30 KB21.24%
D3.js236.82 KB74.51 KB65.75 KB13.32%
Font Awesome1,104.04 KB422.56 KB331.12 KB27.62%
jQuery86.08 KB30.31 KB27.65 KB9.62%
React105.47 KB33.33 KB30.28 KB10.07%
Semantic UI613.78 KB91.93 KB78.25 KB17.48%
three.js562.75 KB134.01 KB114.44 KB17.10%
Vue.js91.48 KB33.17 KB30.58 KB8.47%

At scale, the benefits compound across the whole stack:

  • TLS overhead drops slightly. Smaller files encrypt faster, though the effect is hard to measure and small, since modern CPUs handle encryption quickly.
  • Bandwidth costs fall. The 21% saving recurs on every request rather than occurring once, producing a snowball effect.
  • Edge caches hold more. Only hot files are kept in memory at edge servers; most are Brotli-encoded due to browser support, and the smaller size means more of them fit.
  • Visitors transfer less data. That means less battery drain and lower data charges, particularly on mobile.

Per-request savings are modest, but with a near-zero cache miss rate for public resources, the initial compression cost is amortized within a few hundred requests — after which the reduced overhead is a lifetime benefit.

Mixing Compression Levels by Resource Churn

Not every file deserves Brotli:11. Resources that change frequently, such as custom CSS and JavaScript, run on the private CDN at lower levels so purges and updates stay instant. Open-source resources that change less often come from the public CDN with Brotli:11 already configured. Going through a public and private CDN integration makes the switch automatic.

For a typical website, aggressive compression shaves around 50 KB off page load. A PHP library and a WordPress plugin both switch between the private and public CDN automatically, and both provide full access to the free public CDN; JavaScript, Python and Ruby libraries are not yet available. A search tool can find a matching public CDN resource from a URL, and failing that, library pages list the URLs directly.

The public CDN began with only the most popular libraries to limit malware spread and grows as users suggest additions. Repositories not yet hosted there can be pulled into the private CDN, which imports releases from GitHub and applies aggressive optimization before delivery.

These results come from personal experience running Brotli at CDN scale, at a service whose client sites number in the hundreds; at that size, the aggressive approach pays for itself.