Okay
  Public Ticket #2089547
Font awesome
Closed

Comments

  •  2
    gehess started the conversation

    Hi guys, google´s PageSpeed Insights doesn´t like the embedding of "fa-sold-900.woff2", which takes on mobile 2,49s to load. Any suggestions how to change this?

    Thanks

  •  894
    Zhivko replied

    Hi,

    This file is included in the font-awesome library and I'm not sure at the moment how to deal with this.

    You could try to load your own version of the font-awesome library by adding following action in your theme functions.php file:


    add_action('wp_enqueue_scripts', function(){
        
        // Remove calendar default font-awesome
        wp_deregister_style('stec-font-awesome');  // Load other version of font-awesome
        wp_register_style('stec-font-awesome', 'url path to my custom font awesome library'); 
    }, 9999);

    Stachethemes Developer

  •  2
    gehess replied

    Sorry to bother, but I have to come back to this topic. I tried several options and tricks to solve this, but without success. I tried your advice, but icons just disapear and don´t get exchanged by the local font awesome. Maybe this is related to the free web version I added.

    With the current condition, my site looses on mobile page speed test around 50% of speed due to the stachethemes performance issue. 

    Any help, advice or solution would be great, because I need this tool and I´m a big fan of any other aspect of the plugin. 

    Thanks in advance!

  •  894
    Zhivko replied

    Hi,

    I find page speed insights very frustrating tool that does not reflect the actual speed performance of the site. Even worse is some recommendations it gives contradict the Envato coding requirements. 

    Anyway, if you provide me with wp-admin and ftp I could try to improve the performance of this file.

    I read there are people with similar issue here: https://github.com/FortAwesome/Font-Awesome/issues/14596


    Stachethemes Developer

  •  2
    gehess replied

    Hi Zhivko,

    thank you very much! Your link and the code given there solved it. Sorry, should have found it myself. 

    And yes, I totally agree, "PageSpeed" is very frustrating! Especially because time to load a page isn´t even relevant for the grades. 

    Anyway, it helped me a lot and for anybody with similar issues, go to your functions.php and implement the following:

    add_action('wp_head', 'add_header_code', 5);
    function add_header_code(){
    ?>
        <link rel="preload" href="URL of the font given in PageSpeedInsights" as="font" type="font/woff2" crossorigin="anonymous">
    <?php
    };

    Thanks a lot again!