File Under: Uncategorized

Stop Typekit Fonts From Slowing Down Your Site

That's a fancy-lookin' T you got there.

That’s a fancy-lookin’ T you got there.

Typekit is one of the easiest ways to get fancy fonts working on your website. Just sign up for an account, pick a font and paste a few lines of code into your pages. TypeKit takes care of the rest, ensuring that your fonts load and there’s no unsightly flash of unstyled content (FOUT) or other problems.

There is, however, one possible problem with the default way of embedding Typekit fonts. If the TypeKit code fails to load, it can slow down the rest of your site. Typekit avoids FOUT by pausing your page load for a fraction of a second, but if the Typekit script never finishes loading, that fraction of a second can turn into many seconds. While Typekit has excellent uptime, let’s face it, outages happen, and we understand if you don’t want to hang your own site’s fate on another.

For those worried about depending on Typekit there is a workaround — load Typekit scripts asynchronously. The Typekit blog recently put posted an in-depth look at various way to embed Typekit fonts in your pages, including an asynchronous method which won’t slow down your page should Typekit become temporarily unavailable.

The disadvantage of the asynchronous design pattern that Typekit outlines is that it means a bit of extra code in your pages. Most likely a few more bytes in your HTML isn’t going to cause a significant speed hit, but it is something to keep in mind.

See Also: