Fastest way to Google Fonts
Harry Roberts writes about fastest ways of loading Google fonts on his blog:
It’s widely accepted that self-hosted fonts are the fastest option: same origin means reduced network negotiation, predictable URLs mean we can preload, self-hosted means we can set our own cache-control directives, and full ownership mitigates the risks that come with leaving static assets on third-party origins.
That said, the convenience of a service like Google Fonts cannot be overstated. Their ability to serve the tiniest possible font files tailored to specific user agents and platforms is amazing, and with such a huge, freely-available library served from Google-grade CDNs… I definitely see why people continue to turn to it.
Well, yes. Self hosting fonts is a pain. Can we make it a little faster with the CDN?
Harry dives into a private instance of Webpage test and marks the performance metrics for each attribute that can be used. Here is what he ends up doing:
We can find a sample to this on Harry's site:
On to the fast lane! 👏👏