Skip to main content
New Participant
December 1, 2022

Font Preload Does Not Work

  • December 1, 2022
  • 2 replies
  • 1383 views

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.


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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Mohit_KBansal
Employee
December 5, 2022

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.
New Participant
December 9, 2022

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?

 

arunpatidar
New Participant
December 2, 2022
New Participant
December 5, 2022

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.