sample-pie-shop icon indicating copy to clipboard operation
sample-pie-shop copied to clipboard

Optimize font loading

Open devnook opened this issue 7 years ago • 2 comments

devnook avatar Nov 27 '17 13:11 devnook

e.g. https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization#optimizing_loading_and_rendering

devnook avatar Nov 27 '17 13:11 devnook

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.

samdutton avatar Jun 11 '18 17:06 samdutton