ai / size-limit

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.
MIT License
6.48k stars 1.82k forks source link

Switch from GZIP to Brotli by default #343

Closed kytta closed 8 months ago

kytta commented 8 months ago

Brotli, as we know, is a more superior compression algorithm; fast & effective. According to Can I Use, 97% of devices can use Brotli. It's widely adopted by the servers, too: nginx, Apache, LiteSpeed, lighttpd, Caddy, and others. Big CDNs like Fastly and Cloudflare are enabling it by default.

Wouldn't it make sense for size-limit to flip the switch, too, and show the "brotlied" result by default, making GZIP opt-in and encouraging people to switch their infrastructure?

ai commented 8 months ago

Sounds like a good idea. But I will ask in Twitter first to collect the feedback.

ai commented 8 months ago

Here is PR https://github.com/ai/size-limit/pull/346

ai commented 8 months ago

Here is a good statistics about the real web traffic in 2022 https://almanac.httparchive.org/en/2022/cdn#brotli-adoption

I think it is pretty solid numbers. In 2023, they will be better. And this is the whole traffic. Size Limit users is a little more advanced.

Screenshot from 2023-11-11 07-11-26

ai commented 8 months ago

Released in 11.0.