Expand my Community achievements bar.

Font Preload Does Not Work

Avatar

Level 1

According to the Lighthouse report, fonts should be preloaded because they increase the number of chaining critical requests.
I followed the instructions and added a link to html file as: (while trying to figure out what can be causes to this issue, i tried the same font with multiple paths just to be sure)

<link rel="preload" href="./resources/fonts/CoreSansC-45Regular.f29025b6.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="../clientlib-all/resources/fonts/CoreSansC-45Regular.f29025b6.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/resources/fonts/CoreSansC-45Regular.f29025b6.woff2" as="font" type="font/woff2" crossorigin>


but report was not changed.

cemilcakmak_1-1669904202172.png
Do you have any ideas, what can be the problem? Is this AEM's default behaviour about preloading?

4 Replies

Avatar

Level 1

I watched the video and applied exactly the same solution. 
It's just a one liner code, there is no chance to make error, but didn't work.

Avatar

Employee Advisor

Check the following

  1. Make sure to include preload tag in head section
  2. Make sure to include all paths (check n/w tag with font filter) of fonts added as preload. Sometime, css files generate some random urls.

Avatar

Level 1

Thanks for the reply it didn't work then I realized in the network tab content-type for the font returns application/octet-stream

However in the head I declare type as a font/woff2

Could it be the reason?