google / google/fonts

Support brotli compression

Open
#5,538 3 comments 3 reactions 0 assignees View on GitHub
I API / Website / Platform
Dominant language
HTML
Stars
20.5k
Forks
2.9k
Avg merge
1d 21h
Merged PRs (30d)
95

Description

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.

[Noto Sans TC]: https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&display=swap
[IBM Plex Sans JP]: https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+JP:wght@300;400;500;700&display=swap
[Noto Color Emoji]: https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap
[Roboto]: https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.