Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Server for Webfont's or Self-Hosted?

Tags:

html

css

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 ?

like image 522
Rohitink Avatar asked Oct 07 '12 20:10

Rohitink


People also ask

Is Google self-hosted?

Google Workspace is not available as a self-hosted solution but there are some alternatives for power users and business that want to host a solution on-premise. The best Self-Hosted alternative is CryptPad, which is both free and Open Source.

Can you self host Google Fonts?

To self-host, you need to download the fonts and write the appropriate @font-face CSS rules. Instead of doing this myself, I came across an excellent tool to streamline this process: google-fonts-helper. It holds the entire Google Fonts catalog.


5 Answers

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.

like image 132
Vincent Woo Avatar answered Oct 23 '22 21:10

Vincent Woo


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.

like image 27
amustill Avatar answered Oct 23 '22 21:10

amustill


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.

like image 36
Mario Awad Avatar answered Oct 23 '22 19:10

Mario Awad


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

like image 4
jamie Avatar answered Oct 23 '22 19:10

jamie


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.

like image 2
Jules Avatar answered Oct 23 '22 19:10

Jules