• When analysing posts with Google Lighthouse after installing this plugin, I see that font files are not preloaded. Preloading fonts can speed things up and improve performance scores, and that’s good for SEO.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support gVectors Support

    (@gvectorssupport)

    @galbaras,

    We’re really sorry, but this is not planned yet.

    Thread Starter Gal Baras

    (@galbaras)

    How difficult can it be?

    This code should work (only on pages where comments are being displayed):

    
    <link id='wpdiscuz-preload-0' rel='preload' href='<?php echo esc_url( plugins_url( 'assets/third-party/font-awesome-5.13.0/webfonts/fa-brands-400.woff2', __FILE__ ) ); ?>' as='font' type='font/woff2' crossorigin />
    <link id='wpdiscuz-preload-1' rel='preload' href='<?php echo esc_url( plugins_url( 'assets/third-party/font-awesome-5.13.0/webfonts/fa-solid-900.woff2', __FILE__ ) ); ?>' as='font' type='font/woff2' crossorigin />
    <link id='wpdiscuz-preload-2' rel='preload' href='<?php echo esc_url( plugins_url( 'assets/third-party/font-awesome-5.13.0/webfonts/fa-regular-400.woff2', __FILE__ ) ); ?>' as='font' type='font/woff2' crossorigin />
    
    Thread Starter Gal Baras

    (@galbaras)

    BTW, there are online services that allow you to choose only the icons you need and create a custom font file, which is much smaller than loading 3 complete sets.

    See https://fontello.com/ and https://icomoon.io/, for example.

    Your plugin already offers excellent options for page speed, and this will take it to the next level. Please consider serving a sing font file and preloading it. I’ve already given you everything you need to do this.

    Thread Starter Gal Baras

    (@galbaras)

    There have been 3 releases since this thread was started, and no movement that I see.

    What will it take for you to include smaller, preloaded fonts?

    Plugin Support gVectors Support

    (@gvectorssupport)

    @galbaras,

    Those fonts are not being loaded via the <link> tag, those are added thru the CSS files. There is no way to add the preload for this case. As I’ve already mentioned this is not planned. This requires large changes in plugin codes.

    Thread Starter Gal Baras

    (@galbaras)

    Actually, I’ve already given you a way to preload them. The browser will know what to do.

    I’ve done it on my own site, if you care to look. Check out this page source (works in Google Chrome).

    This can be easily done with a wp_head action.

    Still, you should first combine and trim down the contents of the font file!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Preload and compress fonts’ is closed to new replies.