logoalt Hacker News

porphyralast Monday at 8:12 PM2 repliesview on HN

> If not inlined, subresources can fail to load for all kinds of network reasons.

Also, it's commonly recommended to load fonts asynchronously/deferred without blocking the main page render. But I HATE it when the page jumps around as it cycles through different fonts before the real one loads. I'd rather get dinged on PageSpeed insights with "Requests are blocking the page's initial render, which may delay LCP. Deferring or inlining can move these network requests out of the critical path." rather than have everything popping about for the first second. Is it just me?


Replies

cryzingerlast Monday at 9:02 PM

This drove me crazy on one of my (very lightweight) static sites... even on incredibly fast connections you'd always see that FOUT. I managed to solve it with font-display: fallback.

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...

I also had to make sure I was preloading my fonts properly... not sure if this is the same guide I followed, but it's close. The only difference is that I swapped that "&display=swap" to "&display=fallback":

https://dev.to/pilcrowonpaper/preloading-google-fonts-37h1

show 1 reply
chrisweeklylast Monday at 8:19 PM

Def not just you!