Slide 73
Slide 73 text
Web Font Op$miza$on
• Audit and monitor your font use: do not use too many fonts on your pages, and for each font, minimize the number of
used variants. This will assist in delivering a more consistent and a faster experience for your users.
• Subset your font resources: many fonts can be subset, or split into mul$ple unicode-ranges to deliver just the glyphs
required by a par$cular page - this reduces the filesize and improves download speed of the resource. However, when
defining the subsets be careful to op$mize for font re-use - e.g. you don’t want to download a different but overlapping
set of characters on each page. A good prac$ce is to subset based on script - e.g. La$n, Cyrillic, and so on.
• Deliver op$mized font formats to each browser: each font should be provided in WOFF2, WOFF, EOT, and TTF formats.
Make sure to apply GZIP compression to EOT and TTF formats, as they are not compressed by default.
• Specify revalida$on and op$mal caching policies: fonts are sta$c resources that are infrequently updated. Make sure that
your servers provide a long-lived max-age $mestamp, and a revalida$on token, to allow for efficient font re-use between
different pages.
• Use Font Loading API to op$mize the Cri$cal Rendering Path: default lazyloading behavior may result in delayed text
rendering. Font Loading API allows us to override this behavior for par$cular fonts, and to specify custom rendering and
$meout strategies for different content on the page. For older browsers that do not support the API, you can use the
webfontloader JavaScript library or use the CSS inlining strategy.