Brotli Level 11 and Zopfli offer a significant advantage over the lower compression levels used by the CDN for large JSON, CSV and other binary files.
This is mainly useful for static websites (Jamstack) that use such files, e.g. sites hosted on GitHub Pages, GitLab Pages and CloudFlare Pages. Each file would have 3 versions uploaded to the Git repo.
Depending on the
Accept-Encoding header in the request, a
GET request for
domain.com/example.css would serve one of these files from the origin:
example.css - No Content-Encoding header
CloudFlare already passes through Gzipped content from origin servers but that’s not usable with static sites or Brotli.
I have a large dataset for my PWA and I’m serving a dataset.json.gz file compressed with Zopfli. This file is then decompressed using the Compression Streams API in JS. The savings of Zopfli over CloudFlare/GitHub Pages Gzip is noticeable. Brotli Level 11 would give the best result but it’s not possible to decompress Brotli in JS easily.