WordPress.org

Ready to get started?Download WordPress

Forums

MP6
[resolved] Google Fonts Slows Down Page Load (IMMENSELY) (3 posts)

  1. zlanich
    Member
    Posted 9 months ago #

    I understand the benefits of loading remote libraries like the Google Fonts you're using for MP6, but when I'm developing locally and/or the internet speed isn't the greatest, I'm noticing that the fact that you're loading Google Fonts dependencies remotely is greatly slowing down my page load time. Can you please somehow cache this request or something along those lines?

    Also, you're not checking to see if a user is logged in, so you're loading the Google Fonts remote libs on the front end for all page loads even when normal, non-authenticated users are hitting the site, thus adding unnecessary time to page load.

    Please fix this :(

    http://wordpress.org/plugins/mp6/

  2. Till Kr├╝ss
    Member
    Plugin Author

    Posted 9 months ago #

    Open Sans is registered as a dependency, which means that it gets enqueued only if a styles is loaded that has open-sans defined as a requirement. By default this only happens on the front-end, if the WordPress toolbar is displayed.

    If you don't want to load Open Sans in your development environment, you can easily remove mp6_register_open_sans callback and register your own stylesheet, that loads Open Sans form your local machine.

  3. Jesper Johansen (jayjdk)
    Member
    Posted 8 months ago #

    Hello Till,

    I think the first one is only the case if Open Sans is not enqueued by the theme. The font is not loading on themes without Open Sans, as expected. But if a is enqueuing Open Sans (by using wp_enqueue_style( 'open-sans', ...)), MP6 overwrites that version - even if the toolbar is not showing.

    Example: If a theme is loading font weight 300, 400, and 700. Open Sans is loading 300, 400, 600. Thus font weight 700 is no longer loaded.

    This can be fixed if the theme (or MP6) uses a other name than Open Sans, like Twenty Twelve does, but then Open Sans is loaded twice when the toolbar is showing.

    - Jesper

Reply

You must log in to post.

About this Plugin

About this Topic