News for hackers. Stuff that matters.
Re:Should you self-host Google Fonts? by nirui on Saturday February 22, 2020 @10:06PM (#22394824)
I could add another point: A software should be self-sufficient (at least to a degree). When user opens the page, the page should not require an external service to function.

Imagine a user who can access your page but cannot access Google, the user then has to wait a long time looking at a blank page before the web browser stopped trying, that is some really really bad experience.

And your users won't blame Google for been too slow, they will just simply close your page, and try another search result instead.

Re:Should you self-host Google Fonts? by allenskd on Sunday February 23, 2020 @05:25AM (#22396138)
I usually just download and self-host for this reason. A software should never rely or be dependent to content delivery networks/repositories like Google Fonts. There's nothing wrong with Google Fonts as a service and repository (tracking stuff aside), but I've never felt comfortable at the idea that we just link, lets say, jQuery or Angular through CDN and call it a day.

I should add that most of my work is through intranet applications with servers only accessed through VPN and I've seen the firewall disrupt Microsoft services one too many times so... it's more of a "yea, it's just a save-as or copy file to my app assets folder" versus users sending me emails that the pages stopped working.

Re:Should you self-host Google Fonts? by Havoc on Sunday February 23, 2020 @09:03AM (#22396851)
> A software should never rely or be dependent to content delivery networks/repositories

Not sure that's viable in today's cloud-y world

Re:Should you self-host Google Fonts? by HelloNurse on Sunday February 23, 2020 @10:44AM (#22397359)
It's the cloud that is not viable in a software world. Software is too important to introduce unnecessary dependencies and weaknesses.
Re:Should you self-host Google Fonts? by unlinked_dll on Sunday February 23, 2020 @03:05PM (#22399188)
Eliminating weaknesses to provide services that are faster and more robust is exactly why CDNs exist. Whether or not you find them necessary is up to you. Personally a world with content closer to my machine with more robust servers that can handle high traffic is better than the alternative.
Re:Should you self-host Google Fonts? by mneubrand on Monday February 24, 2020 @05:41PM (#22409230)
You can get the best of both worlds by self-hosting and putting a CDN in front of that. This way you get robustness and your app will still function in isolation
Re:Should you self-host Google Fonts? by chiefalchemist on Sunday February 23, 2020 @09:32AM (#22396975)
I'd add that the nature and value of the internet itself is in having interconnectedness. Perhaps, not initially for a site's infrastructure, but only because no one saw that far ahead. None the less, the ideal was there.

If there's that much fear in connecting elsewhere then we've done something wrong. Of course, there are exceptions. There always are. But the arc of the internet is the natural ability to connect.

p.s. Using a CDN ideally saves the browser time. If I've already visited a site that used the same version of jQuery from the same CND then that's in the browser cache.

Sure. Maybe we need to refine this. I'm not sure. But let's not make connecting and sharing sound like a bad idea.

Re:Should you self-host Google Fonts? by Havoc on Sunday February 23, 2020 @09:38AM (#22397000)
>that's in the browser cache.

As per article that's no longer true. Thanks fingerprinting.

Re:Should you self-host Google Fonts? by pmoleri on Sunday February 23, 2020 @09:23AM (#22396933)
Isn't that like not trusting AWS and have your own reliable data center for website hosting?

Edit: Removed cache statement.

Re:Should you self-host Google Fonts? by sideshowb on Sunday February 23, 2020 @09:42AM (#22397014)
You have to accept that a server may fail to be accessible, whether it's yours or Amazon's. If this is an issue you add redundancy.

When you load lots of resources from God knows where in a way such that any single failure takes the page down, you are reducing the reliability that you could have had if the resources were all in the same place which you concentrate on keeping available.

Re:Should you self-host Google Fonts? by marcosdumay on Sunday February 23, 2020 @12:31PM (#22398143)
If your site runs on AWS, it should run on AWS, not on AWS + Google Fonts + React CDN + Github + ...

But actually, there's nothing wrong with adding dependencies, granted that you correctly do your risk assessment. Are those developers assessing their risks and making an informed decision to add them?

Re:Should you self-host Google Fonts? by pmoleri on Sunday February 23, 2020 @02:17PM (#22398869)
I agree on that, I just don't see fonts as critical for your site, provided that you have a fallback. But I see how hosting the fonts is pretty easy to do and you avoid one point of failure for the user experience.
Re:Should you self-host Google Fonts? by Havoc on Sunday February 23, 2020 @09:37AM (#22396992)
Pretty much.

I'm really starting to doubt whether it's competitive to do your own thing anymore. And this seems to be getting worse.

Hard to compete with the combo of features & scaling that cloud provides. Attempting it pretty much guarantees you a gnarly trade-off somewhere (reliability, complexity etc).

Re:Should you self-host Google Fonts? by yathern on Saturday February 22, 2020 @10:46PM (#22394981)
> Imagine a user who can access your page but cannot access Google, the user then has to wait a long time looking at a blank page before the web browser stopped trying, that is some really really bad experience.

Not quite how web fonts work, usually they just swap in for the system fonts once loaded.

Re:Should you self-host Google Fonts? by nirui on Saturday February 22, 2020 @11:44PM (#22395195)
Yes, a well-designed system can minimize the impact by for example lazy-load the font file or even `Font Face Observer`[0] them for manual hot swap.

But that is not the main point. The main point is: You are the one who's in charge of the user experience, not Google. Don't shift the responsibility to somebody (external service) you don't have control of.

The software works the best when all it's parts are predicable, and make it more self-sufficient can help.

[0] https://fontfaceobserver.com/

Re:Should you self-host Google Fonts? by swiley on Sunday February 23, 2020 @06:59AM (#22396451)
Google’s own pages don’t do that, they intentionally hide the text until the font loads to prevent a “flash of unstylised content.” (It’s quite a bit longer than a flash on many connections, plenty long enough to start reading.)
Re:Should you self-host Google Fonts? by lazyjones on Sunday February 23, 2020 @07:16AM (#22396489)
Very important point. A major Austrian newspaper's web site currently doesn't work for me because I block FB's SDK. My choice in this case, but as a user I'm also at risk when FB can choose to block my browser and disable some (badly designed) web pages in the process.
Re:Should you self-host Google Fonts? by butterthebuddha on Sunday February 23, 2020 @06:18PM (#22400267)
On the other hand, self-hosting everything doesn't let you take advantage of caching.

What I mean is, if two sites use the same resource, and if both sites fetch the resource from the same URL, the resource will likely be cached by the browser once and reused again and again. This can be huge for load times when users visit a website for the very first time.

Or at least, this was the argument that was floating around in the community, when I used to do web dev. It's been a few years since, and I'd be interested to see if people have other arguments for/against this.

Re:Should you self-host Google Fonts? by throwaway777555 on Sunday February 23, 2020 @08:16PM (#22400809)
These are good points, but there are a few things to consider. First, as the article points out, self-hosting may result in a faster experience for your users due to the slowness of Google's font delivery. Secondly, your site is likely already serving up other assets which are not nearly as large as the fonts themselves (CSS, logos, other images, JavaScript, etc), so the savings is really not that large in comparison. Third, you can make use of cache-control headers that will ensure that all of these assets don't expire on the client's side for as long as you'd prefer.

One of the benefits of a CDN is the "N" part. If you host on a single server and you start getting requests from across the globe, those users will have a slightly more fluid experience if they can download the assets from a server that's physically closer to them than if they have to wait for packets to hop across dozens of nodes.

Re:Should you self-host Google Fonts? by spookthesunset on Sunday February 23, 2020 @12:11AM (#22395271)
The odds of google being down / slow instead of your site are pretty bad.

Unless you build your own data center, pull in all the fiber yourself, make the network switches yourself, build the servers yourself, etc... you are always going to be dependent on a third party or external service.

Re:Should you self-host Google Fonts? by pmlnr on Sunday February 23, 2020 @02:05AM (#22395559)
Google is blocked in some parts of the world, so chance of "being down" is actually non zero if you think of the whole world.
Re:Should you self-host Google Fonts? by kube-system on Sunday February 23, 2020 @02:27AM (#22395610)
Also, some webpages don’t even run on the internet.
Re:Should you self-host Google Fonts? by ajphdiv on Sunday February 23, 2020 @09:37AM (#22396995)
True. Saw this issue first hand on a company internal network.
Re:Should you self-host Google Fonts? by adrianN on Sunday February 23, 2020 @12:57AM (#22395391)
It's not instead of, it's an additional failure mode.
Re:Should you self-host Google Fonts? by pjc50 on Sunday February 23, 2020 @06:10AM (#22396289)
For years I blocked google-analytics.com because it was on the critical path for far too many pages loading.
Re:Should you self-host Google Fonts? by rescbr on Sunday February 23, 2020 @05:43AM (#22396201)
The issue isn’t Google being down, it is my ISP’s connection to Google that might be subpar.

They might have a direct peering which is down and unexpected traffic is flowing though transit, you got BGP flaps, you got local CDN outages... and in the eyes of the customer your website is down, not Google CDN.

Re:Should you self-host Google Fonts? by benhurmarcel on Monday February 24, 2020 @09:54AM (#22404421)
> The odds of google being down / slow instead of your site are pretty bad.

If my site is down, they already can't access it. Using Google Fonts just adds an additional failure probability, however small it may be.

Re:Should you self-host Google Fonts? by polyphonicist on Sunday February 23, 2020 @12:21AM (#22395291)
Google has a reputation of shutting their services down. What if they shut their fonts CDN down or change their URLs without redirects?
Re:Should you self-host Google Fonts? by mewpmewp2 on Sunday February 23, 2020 @05:22AM (#22396122)
This might not be end of the world. In a lot of cases convenience is worth the risks. There is no golden rule that one should never depend on third parties. It is always balancing pros vs cons.

Self hosting introduces extra code, resources and assets that you as a developer must introduce and maintain. This is not free.

Especially if worst thing that happens is a wrong font loaded.

Re:Should you self-host Google Fonts? by spookthesunset on Sunday February 23, 2020 @12:22AM (#22395295)
Than a hell of a lot of sites lose their fonts until they update.
Re:Should you self-host Google Fonts? by onion2k on Sunday February 23, 2020 @03:51AM (#22395840)
To be fair, lots of people being affected hasn't stopped Google in the past.

In the case of Fonts though, it's a good source of user and browser data, so it's not likely to be shut down any time soon.