BREAKING CHANGE: pre-compressed assets re-compressed at the edge

It seems due to a recent change pre-compressed assets, eg file.ext.br, are re-compressed at the edge, with an additional Content-Encoding header added, resulting in Content-Encoding: br, br. The browser receives double compressed data. This breaks existing applications.

relying on vercel edge compression, instead of pre-compressed assets, results in 30% larger file sizes as vercel is not using the maximum compression level.

As far as i can tell the change has not been announced or documented.

is there an option to disable this behaviour?
is there a bugfix planned to properly handle pre-compressed data?
why was this not announced or documented?

Hey, @azeitler! Welcome to the Vercel Community.

I can’t see anything that could have caused this change, but could you share an example with us? It’d be easier to show with side-by-side comparisons.

1 Like

Here you go: GitHub - azeitler/wasm-compression-issue

Starting at a 100kb file-size .br files are now compressed again and a second br Content-Encoding header is added resulting in a br, br Content-Encoding header, which Safari cannot handle (but Chrome can).

See this page:

This behaviour is new. Our logs show it started around July 30th.
Our last deploy previous to this regression was July 16th.

The change in behaviour is on Vercel’s side.

Using the edge compression provided by Vercel is not an option because it does not use maximum possible Brotli compression levels resulting in ~30% larger file sizes.

A related problem was reported in October 2024 🐛 Vercel not serving pre-compressed assets (brotli)
The user even provided a demo repository, but never received another answer.