Goodbye Google Fonts
I have been using Google Fonts since I started creating websites. They are really useful. Their performance is great, you get a free cdn and so on. But a lot has changed since those early days. Hosting provides have started offering free CDNs, internet have become a lot faster, caching process has changed, etc… Is Google Fonts still useful today as it used to be? No, I think hosting fonts on your own server is a better option.
Here are some popular points in favour of Google Fonts and my reasons on why hosting your own font trumps them.
1. There is good chance that a popular font is cached as other websites use them
There has been a recent change in how resources are cached across websites. Your website can no longer access resources cached by other websites.
If developer1.com uses Roboto font using Google Font and I use the same font on my website, the font will be redownloaded on my website even if it is cached by developer1.com despite it being the same font. Google has blog post detailing how this works.
It is already implemented in Chromium/Chrome and Safari. Firefox will implement it soon.
2. The cost of hosting and distributing fonts is not yours
While this is true that serving Fonts via Google Fonts will save you some hosting charges, things have changed here too. Hosting charges have became cheaper over the years.
You can also separate fonts into smaller files using Unicode range and the browser automatically downloads only the needed files. This decreases the font size, load times and your bandwidth costs.
3. You don’t have to worry about updating the fonts
This point is still true in most cases. However some fonts are now being distributed via package managers such as NPM which can help you with keeping the fonts updated.
4. You get a free CDN
While this used to be rare it is not anymore. Most hosting provider offer free CDNs even in the basic plans.
So, what to gain by moving away from Google Fonts
- Google Font connects to two different domains for downloading the fonts. It involves DNS lookup and TLS handshake. By switching to your own hosting you avoid that. You get to reduce the no of domain calls, DNS lookups, skip a CSS file loading, etc… If your hosting is fast you’ll definitely get a performance improvement.
- Google Font service could experience a down time affecting your website.
Considering all this I recently switched away from Google Fonts for my own website and I think it is great.