• Resolved activequilibreyv

    (@activequilibreyv)


    Hi there,

    Without Autoptimize my Google PageSpeed insight score for Largest Contentful Paint on mobile for https://activequilibre.ch, is of 2.6s.

    I spent hours, trying different tips and tricks, and trying to figure out what’s the consequences of activating or inactivating options. Autoptimize is now lowering my Largest Contentful Paint from 2.6 (too hight for Google) to 2.1s, which is nice according to Google’s recommendations (tested with Google PageSpeed Insight).

    In the same time, I’m seeing the CLS score of Google PageSpeed Insight climbing from 0 up to 1.104 and therefore too high according to Google’s recommendations.

    I also tried to manually load the Critical CSS code I got from https://www.sitelocity.com/critical-path-css-generator (since I saw your advice in another post), and its lowering the CLS to 0.363, but that’s still above Google’s recommendations.

    How can I simultaneously get a low ‘Largest Contentful Paint’ AND ‘CLS’ ?

    Regards,
    Yvan

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Maybe try generating the critical CSS elsewhere (see links in the AO FAQ) to see if that yields better results activequilibreyv ?

    Thread Starter activequilibreyv

    (@activequilibreyv)

    Thanks a lot for your idea optimizingmatters,

    I don’t see plenty of tools I can try beside sitelocity. There is https://jonassebastianohlsson.com/criticalpathcssgenerator/ but I’m not sure I know how to properly extract the full CSS (as needed in step 2 for this site).

    I’m doing it through Google Chrome Dev tool, viewing CSS files and copy-paste into https://jonassebastianohlsson.com/criticalpathcssgenerator/ the content of Autoptimized CSS.

    I’m getting a nice 0.021 CLS when doing this. But the problem is then, that I miss the Fa-fa Icons of my website. And this Problem isn’t solved by excluding folowing files into CSS options of Autoptimize, and unchecking the last option in order not to minify these:

    wp-content/cache/, wp-content/uploads/, admin-bar.min.css, dashicons.min.css, font-awesome.min.css, font-awesome.css

    What can I do?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    have a look at this video (older, not mine) for a description of how to use criticalpathgenerator activequilibreyv 🙂

    frank

    Thread Starter activequilibreyv

    (@activequilibreyv)

    Thanks for the video. My problem was mostly to find the whole CSS code of my website and the video only shows how to find it through a link of the header.php file. But mine hasn’t got that kind of link. Finally I found a way with the Quick source Viewer add-on for Chrome.

    Nevertheless, I still have the same problem. When I force the Critical CSS code for the ‘is front page’, I lost my Fa Fa icons.

    Can you help me with this problem?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Can you help me with this problem?

    not personally; you’ll have to (find someone to) tweak the generated CCSS if things don’t work with the generated version activequilibreyv ..

    Thread Starter activequilibreyv

    (@activequilibreyv)

    Ok, I see you won’t dig more into this with me. Of course I was a bit dissapointed because I thought that, with your experience in Critical CSS, you would help me more with this problem.

    But I really understand you’ve got your limits. Sooo.. I did a lot of searches, tests, and finally came out with a solution that I expose here, with explanations so that if someone else faces the same problem, he will (hopefully) be able to adapt the solution to his own situation:

    a) one has to consider that the fa-icons are depending from the fontawesome font

    b) therefore, I added the Quick source viewer add-on into Chrome Browser in order to be
    able to extract the whole CSS code of my page when it was set with the automatic
    Critial CSS Rule of ‘Critical CSS’ WP plugin. (With this setting, the performance was
    not fully satisfying but I have the fa-icons prompting ok to my page. So my aim was to
    find what was there, and not into the better setting with the Sitelocity CSS).

    c) I spotted the @font-face declaration below, and when checking into the Critical CSS
    given by https://www.sitelocity.com/critical-path-css-generator I saw that this
    declaration was missing. Therefore:

    @font-face{font-family:FontAwesome;src:url(https://activequilibre.ch/wp-content/themes/glow/css/../fonts/fontawesome-webfont.eot?v=4.4.0);src:url(https://activequilibre.ch/wp-content/themes/glow/css/../fonts/fontawesome-webfont.eot?#iefix&v=4.4.0) format('embedded-opentype'),url(https://activequilibre.ch/wp-content/themes/glow/css/../fonts/fontawesome-webfont.woff2?v=4.4.0) format('woff2'),url(https://activequilibre.ch/wp-content/themes/glow/css/../fonts/fontawesome-webfont.woff?v=4.4.0) format('woff'),url(https://activequilibre.ch/wp-content/themes/glow/css/../fonts/fontawesome-webfont.ttf?v=4.4.0) format('truetype'),url(https://activequilibre.ch/wp-content/themes/glow/css/../fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal;font-display:swap}

    d) I did set the Critical CSS code from Sitelocity through the advanced settings of
    your Critical CSS plugin tab into Autoptimize with the button [Edit] of the rule
    for ‘is_front_page’

    e) I also used the [Add/Edit Additional Critical CSS] button in order to add the
    @Font-Face declaration above to all rules.

    This way I finally got my icons promping all right and with the Largest Contentfull Paint at 2.4s and the CLS at 0 for a score of 93 on Google’s PageSpeed Insight !

    Hope that will help others 😉

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    That is a job well done activequilibreyv, congrats and thanks for sharing here!

    frank

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

The topic ‘Critical CSS causes high CLS’ is closed to new replies.