adobe / aem-guides-wknd

Tutorial Code companion for Getting Started Developing with AEM Sites WKND Tutorial
https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/overview.html
MIT License
285 stars 548 forks source link

Don't load font from CSS - but from HTML head to improve LCP #325

Closed keepthebyte closed 1 year ago

keepthebyte commented 2 years ago

Now with Page V3 - that all JS is executed async - this is no longer the long-pole for LCP. Now the font loading within the CSS becomes to long-pole.

This request is slowing down LCP: https://fonts.gstatic.com/s/asar/v7/sZlLdRyI6TBIbkEaDZtQS6A.woff2

This should not be loaded within the CSS - but from the HTML head with preload like the other font we load today

<link rel="preload" href="/etc.clientlibs/wknd/clientlibs/clientlib-site/resources/fonts/wknd-icon-font.ttf" as="font" type="font/ttf" crossorigin/>

keepthebyte commented 2 years ago

When its comes to loading fonts used in LCP.. this is the order of possibilities:

3rd Party Host

Origin Host