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
Rai Uriarte
5,050 PointsWhat 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
miikis
44,957 PointsHey 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:
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.
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.
Oliver Sewell
16,425 Pointsimport google fonts i think -less effort - not sure though
Rai Uriarte
5,050 PointsYou mean is less effort for us (which it is) or for the load of the webpage?.
Oliver Sewell
16,425 Pointsless effort for us haha im not sure about the webpage i think it depends on the font you pick
Rai Uriarte
5,050 PointsThat 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.
Rai Uriarte
5,050 PointsRai Uriarte
5,050 PointsThanks 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?.
miikis
44,957 Pointsmiikis
44,957 PointsNo problem.
And Typekit does have their own CDN.