• Resolved bxbdev

    (@bxbdev)


    I use Jetpack’s CSS for my site’s CSS edits.

    I’m trying to use Autoptimize to get rid of render-blocking CSS and I’ve been able to get rid of all but 1 request:

    <link rel="stylesheet" id="custom-css-css" type="text/css" href="https://domain.com/?custom-css=1&csblog=1&cscache=6&csrev=54" />

    This appears directly before the closing </head> tag.

    I think it’s the Custom CSS from Jetpack.

    In the Autoptimize plugin’s CSS settings I’ve got ‘Inline and Defer CSS’ checked and have my critical CSS in the corresponding text area.

    How should I approach this to avoid it being a render-blocking issue?

    Thanks!

    https://www.ads-software.com/plugins/autoptimize/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Frank Goossens

    (@futtta)

    AO only aggregates static CSS-files (i.e. *.css), which that link is not.

    What you could do is move that custom CSS elsewhere (either a plugin that includes the custom CSS inline or add it to a .css-file and enqueue that with a couple of lines of code)?

    frank

    Thread Starter bxbdev

    (@bxbdev)

    I figured out what was causing the CSS file to be render-blocking, though I’m not sure why it works this way…

    I use comment blocks to make the SCSS file easier to navigate. Here’s an example of the format I use:

    //=======================================================
    // VARIABLES
    //=======================================================

    This resulted in a render-blocking CSS file. However, if I remove just the first line of the comment, making it look like this:

    // VARIABLES
    //=======================================================

    The resulting CSS file is NOT render-blocking!

    Again, I’m not sure why this makes a difference, but it does. I’ve tested it multiple times to make sure it wasn’t a fluke.

    After removing the first comment line from each of the comment blocks I ran the PageSpeed test again and it worked! No more render-blocking and my Speed score went from 80 to 87!

    Plugin Author Frank Goossens

    (@futtta)

    I think you’re gaming GPSI there somewhat @bxbdev ??

    Nice find though!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Jetpack CSS Not Deferring?’ is closed to new replies.