Preload Fonts

Preload Fonts helps address the PageSpeed recommendation to Preload Key Requests. The feature is found on the Preload tab:



How to Use Preload Fonts

The Preload Fonts option allows you to tell the browser to start downloading fonts that it otherwise wouldn't discover until much later. This is usually because the font is referenced from within a CSS file. 


Preloading fonts will improve load time and perceived performance.


Which fonts should I preload?

Google PageSpeed Insights will point out any fonts that could benefit from this optimization under the Opportunity, Preload Key Requests:


TIP: Bypass WP Rocket when running a PageSpeed test to discover candidates for font preloading.

  • Right-click on the recommended font in PageSpeed and copy the URL
  • Paste the URL into the "Fonts to Preload" field. 
  • The font must be hosted on your own domain or your CDN's domain. You cannot enter externally hosted fonts like Google Fonts here - those are optimized automatically: Optimize Google Fonts
  • The font URL must match exactly what PageSpeed provides.


Don't Preload Everything!

Preload should be used sparingly to avoid creating a bottleneck. Only preload fonts that would otherwise delay the rendering of the page or the perceived performance. If you preload too many fonts which are not needed right away, you will decrease the performance of your site.


Don't preload multiple formats for the same font. Adding the .woff2, .woff, .ttf, .eot, .svg format on the preload box for the exact same font will just force the browser to preload multiple font files while it needs just one (the .woff2 in most cases).


Using Preload Fonts with Remove Unused CSS

When the Remove Unused CSS feature is enabled, Preload Fonts will be disabled.


Instead, all the found fonts in the resulting used CSS will be preloaded and inserted to the page before the CSS block. This only applies to fonts in used CSS, not in the Preload Fonts box.


In theory, you won't need to manually preload fonts when using Remove Unused CSS.


Preloading in Action

When you enter a font URL for preloading, WP Rocket will apply the preload tag as follows, just after the closing title tag, </title>, of your site:


<link rel="preload" as="font" href="https://example.com/wp-content/themes/paperback/inc/fontawesome/fonts/fontawesome-webfont.woff2" crossorigin><br>

    

This optimization will be applied on both cached and uncached pages.


With preloading, you will see the font being requested earlier in the waterfall and it should improve load time and the first paint time.


You can pre-load the fonts instead by using the WP Rocket plugin. Learn more by visiting the article link below:

https://docs.wp-rocket.me/article/1317-preload-fonts


Please note that different icon fonts extensions are necessary for web compatibility.