I love Google Web Fonts. They’ve really prettied up the internet. On the other hand, I don’t like how much they slow down load times. Here’s a little trick to speed them up a tiny bit.

Once you have selected a font, Google Web Fonts gives you a CSS file to include on your page. It looks something like this…

<link href='http://fonts.googleapis.com/css?family=Ubuntu|Sacramento' rel='stylesheet' type='text/css'>

If you open that stylesheet in a browser*, you’ll see that it’s just a few @font-face calls to load-up the font. (*View this CSS file with IE. Google must be doing some browser detection. In webkit, I only see the .woff version on the fonts.) The CSS file will look something like this…

@font-face {
font-family: 'Sacramento';
font-style: normal;
font-weight: 400;
src: url(http://themes.googleusercontent.com/static/fonts/sacramento/v1/WFDkXpubrEwopJnSlHV6CFQlYEbsez9cZjKsNMjLOwM.eot);
src: local('Sacramento'), local('Sacramento-Regular'), url(http://themes.googleusercontent.com/static/fonts/sacramento/v1/WFDkXpubrEwopJnSlHV6CFQlYEbsez9cZjKsNMjLOwM.eot) format('embedded-opentype'), url(http://themes.googleusercontent.com/static/fonts/sacramento/v1/WFDkXpubrEwopJnSlHV6CBsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 400;
src: url(http://themes.googleusercontent.com/static/fonts/ubuntu/v4/_tMhxyW6i8lbI7YsUdFlGA.eot);
src: local('Ubuntu'), url(http://themes.googleusercontent.com/static/fonts/ubuntu/v4/_tMhxyW6i8lbI7YsUdFlGA.eot) format('embedded-opentype'), url(http://themes.googleusercontent.com/static/fonts/ubuntu/v4/_xyN3apAT_yRRDeqB3sPRg.woff) format('woff');
}

Pretty, huh? Now, copy/paste this into your main stylesheet and delete the Google Fonts CSS include. As we learned before, modern web browsers only download the files they need. So the unused version of the font wont slow you down. Eliminating that one request on my site saved me about 200ms (+/-100ms) on the initial load time.

53 Comments

  1. John

    If we open the same stylesheet link from Safari, you will get the trutype (.ttf) file link. Including that also is a good option. If we don’t have Safari installed, we could use the “User Agent Switcher” Firefox add-on to change the user agent to “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.54.16 (KHTML, like Gecko) Version/5.1.4 Safari/534.54.16” and open the stylesheet to get the link to .ttf file.

  2. Dennis Sinacola

    Yeah I don’t this isn’t a good idea Dave imho. I see why you’re doing it, but that Google url will serve up different css for different browsers, and will bring in different font files dependent on the browser, including .woff, .ttf, .eot and .svg. If you copy all the relevant css, you’re bringing in unnecessary font files which will be even slower since you’d need to bring in all the font files, defeating the performance purpose. There’s a reason Google’s doing it this way. I think the best way to speed this up would be to serve the files locally and do your own browser detection.

  3. EdwinHet

    информационный портал https://info-ukraine.com о событиях в Украине и мире. Читайте актуальные новости, интересные статьи, обзоры и аналитические материалы. Экономика, общество, политика, культура, технологии и повседневная жизнь — полезная информация на разные темы.

  4. WilliamSix

    информационный портал https://info24.com.ua о событиях в Украине и мире. Читайте актуальные новости, интересные статьи, обзоры и аналитические материалы. Экономика, общество, политика, культура, технологии и повседневная жизнь — полезная информация на разные темы.

  5. ArnoldDouts

    Новости Украины https://novitnosti.com и мира, полезные публикации и интересные материалы на Info24. Изучайте события общественной жизни, экономики, бизнеса, науки, технологий и культуры. Читайте тематические обзоры, знакомьтесь с актуальными тенденциями и получайте информацию на самые разные темы.

  6. LouisFag

    онлайн-портал https://pedia.com.ua познавательных публикаций для широкой аудитории. Здесь собраны интересные статьи, полезные рекомендации и тематические обзоры о здоровье, образовании, семье, воспитании детей, домашнем хозяйстве и современных технологиях.

  7. EmoryShogy

    Нужен фуршет? https://yaposhik.ru для корпоративных мероприятий, свадеб, дней рождения и деловых встреч. Организация выездного обслуживания, приготовление закусок, канапе, десертов и напитков. Подберём меню с учётом количества гостей, формата мероприятия и бюджета.

  8. LarryDriew

    ChronoSeasons https://chronoseasons.com men’s luxury watches, curated by season. Shop quiet luxury dress watches, Tissot COSC chronometers, Paul Rich Star Dust, dive, pilot chronograph and skeleton watches from 9 houses. Genuine, new and boxed, free US shipping on most brands, 30-day returns.

  9. Billykaw

    Хочешь праздничный фуршет? фуршетные наборы для деловой встречи, вечеринки, презентации или торжества. Приготовление свежих закусок, мини-бутербродов, канапе и десертов. Подберём меню под формат мероприятия, количество участников и бюджет. Удобное оформление заказа.

  10. RobbieVor

    Копицентр «Копирыч» https://kopirych.by профессиональный партнер для тех, кому нужна качественная печать фото в городе минск и по всей Беларуси. Мы предлагаем полный комплекс полиграфические услуги для частных клиентов и компаний: от срочной подготовки документов до изготовления рекламной продукции и персональных сувениров.

  11. JamesPypem

    Хотите заказать кейтеринг мини бургеры? Предлагаем вкусные бургеры небольшого размера с мясными, сырными и другими начинками. Подходят для фуршетов, вечеринок и корпоративных мероприятий. Узнайте цены, выберите количество и оформите доставку.

  12. JamesFaimi

    Ищете, где заказать кейтеринг? https://jekrailcafe.ru для частных праздников, корпоративов, конференций и презентаций. Фуршетные и банкетные меню, канапе, горячие блюда, десерты и напитки. Доставка, сервировка и профессиональное обслуживание мероприятий.

  13. DavidBub

    For teams researching buy instagram story views, a useful starting point is a simple brief listing the content URL, desired volume, deadline, and acceptable risk. If the service asks for information beyond a public content link, the buyer can pause and review why that data is necessary before continuing. A defined review point prevents the test from drifting without direction.

  14. JuliusBub

    A page discussing buy instagram likes is more helpful when it shows the complete package conditions rather than highlighting only a low price or large number. A request for an account password deserves caution, and users can inspect the checkout fields before providing personal or payment details. This keeps cost, convenience, and account considerations in the same decision.

  15. EmanuelRor

    Recommendations about buy tiktok views are more useful when they identify exact package conditions, delivery methods, review dates, and potential account considerations. Users should avoid services requesting unnecessary account credentials and should confirm what personal information is collected before completing an order. A cautious test provides more information than assumptions.

  16. HarryWes

    A request to buy instagram views can be translated into a production checklist covering the hook, visual rhythm, text readability, audio balance, and ending. Capture the initial view count, reach, watch-time indicators, shares, saves, comments, profile actions, and publication timestamp in one dated record. Current Instagram rules should be reviewed before any third-party engagement service is used.

  17. DavidBub

    To assess buy tiktok likes responsibly, compare the proposed activity with current platform rules and the account owner’s tolerance for possible enforcement. Compare the offer with current TikTok rules and avoid sharing passwords, authentication codes, or unnecessary account access with an outside service. The conclusion should describe what was observed without claiming that the order caused unrelated campaign results.

  18. LarryABOTA

    When assessing crypto casinos, it helps to document the complete account journey from registration and verification to withdrawal and account closure. Look for clear explanations of randomness, game providers, account verification, complaint procedures, and the authority responsible for oversight. Consistent scoring keeps a large bonus from masking weaker documentation or support.

  19. WayneAcice

    Новости криптовалют https://coinmag.org актуальный курс биткоина и аналитика цифрового рынка. Следите за изменениями стоимости BTC, ETH и других популярных монет, изучайте прогнозы экспертов, рыночные обзоры и инвестиционные тенденции. Всё о криптовалютах и блокчейн-индустрии.

Leave a Reply

Your email address will not be published. Required fields are marked *