Web performance idea - ship popular web fonts as a system add-on

How about this…
We make an add-on that is only on by default in Nightly and Beta kinda. Or, only for people willing to help out by allowing it to phone home to Mozilla.
The add-on sniffs which web font files get downloaded from CDNs. Just the URL and Unicode range.
We collect that data, sort by most common, download those web fonts in a system addon (capped at some max total file size).
Then once shipped in the browser, the browser will intercept all font requests in CSS and instead of asking if it exists on the system (e.g. Arial) it checks if it exists built-in in the system addon (e.g. Lato Bold) and only if it doesn’t exist there it proceeds to download the web font from the Internet as normal.

Basically, pre-cache a bunch of popular web fonts. It’d save surfers TB of combined network traffic. The user would think Firefox is faster.

Also, browsers cache web fonts but whenever I refresh the page, since the likes of fonts.gstatic.com doesn’t use immutable, every page refresh incurs a web font download (if the CSS uses it).

2 Likes

This sounds awesome to me. Storage on my computer is way cheaper to me than net requests.
I think it should be an addon and not buitl-in though, so that way people can choose if they want it (storage vs network costs).