WebPagetest Forums
preload font - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Optimization Discussions (/forumdisplay.php?fid=5)
+--- Thread: preload font (/showthread.php?tid=15483)



preload font - amsa - 08-30-2018 04:20 PM

hi

I order to improve my perf i decide to preload my font.
Code:
<link rel="preload" href="https://www.mydomain.com/font/specialelite.woff2" as="font" type="font/woff2" media="screen and (min-width: 624px)"

But in consol I got the following message
Code:
The resource https://www.mydomain.com/font/specialelite.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

But this font is used? So, is there anyone who can explain me my mistake?


RE: preload font - andydavies - 09-04-2018 08:13 PM

Add the crossorigin attribute i.e.

<link rel="preload" href="https://www.mydomain.com/font/specialelite.woff2" as="font" type="font/woff2" crossorigin>


RE: preload font - amsa - 09-04-2018 08:29 PM

@andydavies

Thanks for you help, but this doesn't change anything and I'm not surprise as i load font from my own domain.


RE: preload font - andydavies - 09-05-2018 10:07 PM

Do you have a link to the page in question?


RE: preload font - amsa - 09-05-2018 10:15 PM

Thanks a lot I sent you by PM


RE: preload font - malchata - 11-05-2018 04:34 AM

This might be something you've already done, but try disabling the media query (to simplify testing as much as possible) and double check the font you're loading is being downloaded by the current page in the network tab. Document/CSS parsers in browsers will speculate whether they should load a web font by examining the text content on a page and the styles applied to it.