google / fonts

Font files available from Google Fonts, and a public issue tracker for all things Google Fonts
https://fonts.google.com
17.85k stars 2.6k forks source link

Support brotli compression #5538

Open james58899 opened 1 year ago

james58899 commented 1 year ago

Please add brotli compression support to CSS API.

Currently, the CSS API uses gzip compression, but the CSS size will be large if using a lot of fonts or some fonts with a large number of characters, and worse if using multiple weights. Most browsers already support brotli, use brotli encoding will significantly save network traffic.

Some font CSS test[^1]: Font Origin Gzip Brotli
Noto Sans TC 482368 134474 20741
IBM Plex Sans JP 464852 122655 19626
Noto Color Emoji 8085 2118 1541
Roboto 17720 983 785

[^1]: All sizes in bytes. Using gzip and brotli CLI tools with default compression level.

davelab6 commented 1 year ago

@james58899 thanks for reaching out, I'll raise this internally

james58899 commented 1 year ago

Is there any progress?

Font CSS is usually on the critical path of web page rendering, so I think supporting brotli would be a huge speed improvement.

james58899 commented 1 month ago

It is now 2024, maybe consider supporting zstd compression as well.