Hosting Assets: Do It Yourself?

I have started hosting more and more of the assets for sites, like web-fonts and JavaScripts libraries, stats, with the sites themselves instead of using a CDN / third-party service, largely because I was starting to feel squeamish about my role in helping tech giants follow you across the internet.

This is a process and I’m not a purist, yet. So on this site, as an example, I’m still using Google fonts, served to you directly from Google. This is a WordPress site and I’m using GeneratePress rather than a custom-build theme, because of the time gain it gave me when I set it up. This blog, when I started it a few months ago, was an experiment. I wanted to see if the format would work for me, before I invested my time in designing it. But theme customizers in themes like this rarely allow for custom fonts. And on the rare occasion that they do, Astra has an integrated plugin for example, it has been a hassle to get it to work.

So doing things manually, like with this beautiful service: Google Webfonts Helper, or Font Squirrel (that I always used before most of my sites were made with WordPress), and then adding your own CSS is the best option, but I haven’t yet had a chance to make that change for every single website I have ever used Google Webfonts on, including this one.

And then I came across the article Should you self-host Google fonts? by Barry Pollard and things became a whole lot more interesting.

As another reason to self host he adds speed, of course; loading times matter. There’s more to it, but he makes a good point about HTTP/2:

The theory behind this was that browsers limited the number of connections to each domain (typically to 6 connections) so using another domain gave you 6 more connections. While that may have been true in the past (particularly when browsers limited it to less than 6 domains) and before HTTPS became the norm, now connections are expensive to create. Additionally HTTP/2 actually benefits from one connection (mostly!) so using other domains is often a performance cost rather than gain.

Barry Pollard

This, I’ve found, is true, but when I saw the increase in loading times Barry had from switching to self-hosted, I was still a bit shocked: 3 seconds!

Anyway, he does a little more than just a straight up switch, as I’ve been doing, but the biggest improvement is no longer having to wait for Google’s stylesheet.

If you want to know more, definitely read his article, he has all the nitty-gritty worth knowing and it’s a good read!

Photo of Central Park from a top appartment in the Dakota, by me

Leave a Comment