WPTT / webfont-loader

Download webfonts and host them locally on a WordPress site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In multisite, if font is loaded or updated, it will updating to all subdomains sites

GauravKhupse opened this issue · comments

In the Astra theme, we have used this library to load the font.

Test case:- When we updated the font on one first subsite, this font is updated on the second sub-site with the first site URL.

I have created a video, so you can easily understand the problem:- https://share.bsf.io/qGux1NYP

I hope, you will provide a solution or help to this issue with multisite.

Can you please try replacing this line:

$result[ $font_family ][] = $font_family_url;

with this:

$result[ $font_family ][] = parse_url( $font_family_url )['path'];

That should convert absolute URLs to relative, which I believe will work for subdomain multisite installations too.

Let me know if that works so we can fix it in the repository 👍

Thanks for looking into this issue.!

I tried both changes as per your mention but the issue still showing at my end.

Please refer to this video:- https://share.bsf.io/E0uZEwOx

If you need any help to resolve this issue let me know!

Is there any update on this issue?

Waiting for any update...

Hello there,

This issue, which was reported earlier, has been resolved in Astra.

The fix will be released shortly. You may refer to https://github.com/brainstormforce/astra/pull/5625 to access the fix PR. I would also like to bring to your attention that the issue has been closed with a comment. Please visit https://github.com/brainstormforce/astra/issues/5291 to have a look at the comment.

If I'm not mistaken, the fix in Astra will create lots of duplicate files 🤔
So if there are 100 sites that all use the Noto Sans font, then each site will need to download the font separately, taking up hundreds of MB of disk-space instead of just a couple MB.
The problem is not that the font-files are not separated by site... That is by design. The problem is the generated font-file URL. Or am I wrong?

This issue still exist in the current latest version 4.6.3. It happens once Preload Local Fonts is turned on, while it does not happen if this is turned off.

Hello @aristath ,

You're correct in pointing out the potential issue with duplicate files in Astra. However, it's not just the font-file URL; the problem extends to the entire font files being replaced by the new files of the current sub-site. To address this, I'm open to suggestions for a better alternative. Please feel free to share your thoughts on how we can optimize this process and avoid unnecessary duplication of files across sites.