Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

What is faster? import Google Fonts or have the fonts with @font-face in my site?.

Hello there, one quick question, what is faster? import Google Fonts or have the fonts with @font-face in my site?.

4 Answers

Hey Rai,

Using Google's Content Delivery Network (CDN) to serve your font files will invariably be faster than serving each font file from your individual server. Using a CDN enables two main superpowers, in terms of speed:

  1. You'll have an additional domain at your service. Most browsers restrict the number of concurrent connections you can have from a single domain (the max is usually 4 connections, I think). Using a CDN will allow you to have another ≈4 connections that serve files (in this case font files) simultaneously.

  2. You'll be able to take advantage of the network part of Content Delivery Network. Odds are that whomever is accessing your website will be closer to one of the servers in Google's CDN than they will be to your individual server. As a result, reduced distances will equal greater performance, in terms of speed.

Thanks Mikis!, Precious information about the 4 connections. What about Typekit, they have a CDN or I need to download an refer to it with @font-face?.

No problem.

And Typekit does have their own CDN.

Oliver Sewell
Oliver Sewell
16,425 Points

import google fonts i think -less effort - not sure though

You mean is less effort for us (which it is) or for the load of the webpage?.

Oliver Sewell
Oliver Sewell
16,425 Points

less effort for us haha im not sure about the webpage i think it depends on the font you pick

That is what I want to know, I don´t butter to make a special effort if I find a better font out of Google Fonts.

Thanks Oliver.