sample-pie-shop
sample-pie-shop copied to clipboard
Optimize font loading
e.g. https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization#optimizing_loading_and_rendering
I've had a go at this on the font branch.
I followed suggestions from the article, but they seemed to make loading slightly slower.
Using what we had before, with a link to the Google Fonts CSS file (and no <link preload ...>
) DomContentLoaded for the home page and other pages is 1.34 s according to Chrome DevTools in Fast 3G emulation.
Removing the link to the Google Fonts CSS file, and only adding the required @font-face
rules to main.css, and adding <link preload ...>
for each required font weight, DomContentLoaded is 1.52 s.
Please check the font branch — I may be doing something wrong :).
If not, I suggest we leave the usage of web fonts as it is.