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

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

Open
GauravKhupse opened this issue Aug 25, 2022 · 8 comments

Comments

@GauravKhupse
Copy link

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.

@aristath
Copy link

aristath commented Aug 29, 2022

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 👍

@GauravKhupse
Copy link
Author

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!

@GauravKhupse
Copy link
Author

Is there any update on this issue?

@yssambare12
Copy link

yssambare12 commented Jan 20, 2023

Waiting for any update...

@garvits-bsf
Copy link

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.

@aristath
Copy link

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?

@xianglinkong
Copy link

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.

@garvits-bsf
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants