• Resolved szmigieldesign

    (@szmigieldesign)


    Just an idea – right now there’s a setting to load CSS asynchronously with exceptions possible with data-no-async=1. However, it’s problematic to pass such parameter when using commercial themes. It is also quite probable that either layout or advanced plugins will break (to a certain extent) with asynchronous CSS, which makes this an advanced optimization practice (async this, don’t async that, manual work).

    However, one thing that could benefit greatly from async is Google Fonts. My suggestion is to add an option to just load Google Fonts CSS asynchronously (as a settings switch without any advanced details) and leave every other theme CSS intact. The idea is to make the caching plugin filter all Google Fonts requests and append async so that theme modification won’t be necessary but loading speed will be greatly improved without the need to pass data-no-async=1 to all other CSS files.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Hai Zheng?

    (@hailite)

    is there any reason that you want only google font async?

    Thread Starter szmigieldesign

    (@szmigieldesign)

    Because they are loaded externally. Every other CSS loads from my domain and making it go async results in flash of unstyled content and sometimes even breaks the layout (BeTheme, Slider Revolution).

    I work a lot with some commercially available WordPress themes (like Avada, BeTheme, Swift Themes) and typically the only resource loaded from different domain is Google Fonts. Making it async would improve the loading speed without the need of doing too much tweaking (either make it go async or not).

    Plugin Support Hai Zheng?

    (@hailite)

    That makes sense.

    Will add in next release. Thanks.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    Awesome, thanks!

    Plugin Support Hai Zheng?

    (@hailite)

    You are most welcome.

    Yoav Rheims

    (@yoav1987)

    Then, in addition, you could add this in the head:

    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>

    Plugin Support Hai Zheng?

    (@hailite)

    Glad to know. Will add into the same option Load Google Fonts Async.

    Yoav Rheims

    (@yoav1987)

    Aha! Love to be heard ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Google Fonts async’ is closed to new replies.