9

I am using Google Webfont's with my website. Should i let the fonts stay hosted on Google's Server and reference the required stylesheet(s) from my <head> or should I download the font and upload them on my server and use @font-face.

Which of the methods will out more load on my server and make my site slower.

The Size of the font is 40KB. But, when I use a Pingdom's Pagespeed tool, the downloaded font-size is shown in a few bytes.

Pingdom Screenshot

But, When the font is hosted on my server, I think the full 40KB file is downloaded by the client. Why does this happen ?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Rohitink
  • 1,154
  • 3
  • 14
  • 21
  • Almost duplicate: http://stackoverflow.com/questions/12715614/google-web-fonts-vs-actual-font-files-for-all-devices – jtheman Oct 07 '12 at 20:08
  • 1
    Sorry. But that post does not answer the speed related issue. – Rohitink Oct 07 '12 at 20:12
  • Well it kind of does. But you really have several questions in one. Of course downloading more information from YOUR server will put more load on that, but not neccesarily making the site slower. On the contrary relying on Googles servers might slow your site down as said in my linked post. – jtheman Oct 07 '12 at 20:23

5 Answers5

23

My biggest personal motivation for not using Google's webfont hosting is that it happens to be blocked in China. If loading in China is at all important to you, it's definitely worth it to self-host.

Vincent Woo
  • 2,650
  • 1
  • 20
  • 21
18

Keep them on Google's servers.

The reason why you're seeing the small file size from Google is because your browser has already downloaded and cached the file. When you uploaded to your own server, your browser had to download it once again as it considers it a new source.

This fact is also one of the reasons you should reference the fonts from Google, as visitors to your site may have already downloaded them from another site that uses the same font from Google.

Hosting them yourself would naturally put additional load on your servers. Having Google host them lets them deal with that load.

Moreover, by referencing from Google you are letting Google handle the maintenance, such as updates to the fonts as well as the syntax that serves the fonts themselves.

amustill
  • 5,274
  • 23
  • 15
  • 2
    One notable exception for this is for sites that are meant to work on a LAN environment, and it also causes all sorts of delays with automatic test suites like angular e2e. – Pedro Aug 19 '13 at 03:29
  • For German sites: Don't use Google Font, because then you can receive a fine for violating the GDPR. So self hosting is the better option then. Sadly. – dewey Oct 26 '22 at 10:54
16

Well, here's another take: Host them on your server!

Sleep better at night, especially if you're a web developer.

Reasons.

  1. It's more robust especially for visitors with slower/less-reliable connections. A visitor might resolve your domain but fail to resolve Google's and hence ends up with a lot of latency or without the font file, which is essential of course.

  2. It's safer. Remember Google Reader? Google took it down completely. Google Apps? Google made it paid with no free plans, even tiny free plans were not given. So basically, you never know when Google Fonts will get shut down or made for pay. If you're a web developer, this gets multiplied by the number of websites you develop. Would you like to handle 10 or 20 or more angry clients in a few years when that happens?

Yes it's more work to self-host, but I think it's worth it. Especially for Point #2.

Cheers.

Mario Awad
  • 1,410
  • 17
  • 32
  • 3
    I agree with these sentiments. There are some cases that it could be better to self-host. Personally, I develop sites off-line, so if I want to work with the font locally during layout and design, I'll need the font served from my local server. I live in a remote area and often 3rd-party urls will not resolve and the site hangs up. Also, if the user has a fast, reliable internet connection, they're not going to notice a difference whether the fonts (which should be a very small portion of the site) come from you or from google. – i_a Jul 01 '14 at 17:50
  • And here's a link to make self hosting easier for you: http://www.fontsquirrel.com/tools/webfont-generator - If you search FontSquirrel too you'll find plenty of open source fonts with their Web Kits already generated for you to download. Cheers. – Mario Awad Jul 15 '15 at 09:10
  • 1
    Everywhere I see, I get the result "use google's server". But I have to say I have witnessed point #1 multiple times and its irritating. Have used google fonts a lot, right now going to use self hosted and will practically know the difference! – SuperNOVA Aug 22 '16 at 09:12
4

There's also a new option by Adobe and Google: https://edgewebfonts.adobe.com/fonts maybe worth taking a look :-)

Kevin McCann
  • 511
  • 5
  • 13
jamie
  • 545
  • 7
  • 20
1

Unless you're using a high-quality, low-latency dedicated server, use Google as your host. And not just for web fonts. Google hosts jQuery, and a number of other projects, as well.

Jules
  • 14,200
  • 13
  • 56
  • 101