Skip to content
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

Reduce number of fonts loaded #6770

Closed
bwafels opened this issue Jul 9, 2024 · 1 comment
Closed

Reduce number of fonts loaded #6770

bwafels opened this issue Jul 9, 2024 · 1 comment

Comments

@bwafels
Copy link

bwafels commented Jul 9, 2024

Is your feature request related to a problem? Please describe.
Recently I have been looking more into optimizing my site for mobile and around 60% of my homepage size was fonts being loaded. This seems like an important performance improvement to me.

Describe the solution you'd like
There are a few solutions to enhance this:

  1. Inform users to the fact that they use different font families (e.g. I was using 3 font families for certain icons) on the same site. I did not know it loaded the full font for it.
  2. My site loads the same Google Font (Montserrat) 3 times before the image ATF. This is because it uses three different links. Once for the theme that loads it, once for the custom CSS "font-family" and once in a plugin setting. Combine these to point to the same URL.
  3. If several fonts are needed perhaps only load the icons that are really used. I use 3 font awesome icons for social media as these are not available in the other icon font family, I use that are more linked to my website style.
  4. Better control the fonts that need to be loaded first. A code snippet solution is not OK as WP-Rocket prides itself on its ease of use.

Describe alternatives you've considered
I have been manually trying to limit the number of fonts now that I understand its impact

Additional context
initially:
image

after a little work but still rather bad (less icon families):
image

As extra context: RUCSS was preloading 7 fonts for my site. I had a google pagespeed score for mobile of 60%. I found the code snippet to reduce this preloading for several fonts and after that and getting rid of 3 fonts for certain icons it went to 90%. The images above are already after reducing the preload function.

@piotrbak
Copy link
Contributor

piotrbak commented Jul 9, 2024

Hello @bwafels thanks for creating the issue. We're working on improving the automatic preload fonts feature, as it works very well for the most websites, it can preload too much for the minority.

In terms of informing users about the number of fonts loaded, this is not something we could do in the short term. We can go back to the topic later on though.

@piotrbak piotrbak closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants