Re:Google Webfonts, the Spy Inside?
by Throwaway90283 on Friday February 20, 2015 @07:51PM
(#9084124)
Keep in mind the Google CDN is blocked in countries such as China, so your web fonts are not going to render for those visitors, and if you rely on jQuery from the Google CDN, those visitors will experience a broken site. If you have a global reach, this is one reason to self host.
[ Parent
| on HN ]
Interestingly, that's true for scripts but it's not for webfonts because @font-face allows multiple sources, including local system fonts, and the browser will keep trying until it finds one which works.
Here's a test page: http://chris.improbable.org/experiments/browser/webfonts/web...
You can see that it first gets a 404 before continuing on to a URL which works:
Steve Souders from Google goes through dealing with this [1] and I was surprised to see how Twitter approached this (basically encouraging putting sync javascript link at the top of the page)
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
window.jQuery || document.write('<script src="/js/jquery-1.9.1.min.js"><\/script>');
</script>
This has to be pretty standard in 2015 right?
This still has to time out on the first request to trigger, right?
Yes – you could do something creative with async scripts but then you're transferring too much data for everyone to benefit only the subset of users who experience failures on the first script.