-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New font loading causing slower performance #96
Comments
Looks like NextJs has some optimizations possibilities, but it doesn't work for the current font's host we're using: |
I think self hosting is the best option here so we get more control. We can move the font in |
Just taking some random notes here. The component requests information from api.fontshare.com and we get the following response back
Which then causes the following dependent fonts to be loaded. Probably based on the size of the browser. |
Ran a lighthouse audit on the site and saw this:
It appears the introduction of the new font was done in a way that introduces a bottleneck before DOM rendering can be completed. It's the second thing to load when looking at the network tab, and it then causes subsequent loads later on of the actual woff2 files
https://web.dev/render-blocking-resources/?utm_source=lighthouse&utm_medium=devtools
Ideally, we would mark this script as
async
ordefer
, so that it doesn't block rendering of the page. Or, self-host the font in the_next/static
folder so it's faster to retrieve.I don't fully understand the usage of this script / api, so I could be wrong, but it should probably be looked into at some point if Lighthouse is flagging it.
The text was updated successfully, but these errors were encountered: