• Resolved Jim Reekes

    (@reekes)


    Google’s Page Insights is reporting wp.min.js is render blocking for 450?ms.

    I have AutoOpimize running and trying to improve performance. We need to exclude WPP, yet this is blocking the page for half a second. Yikes.

    Is there a way to defer it, or somehow cause it not to be blocking?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    The file itself is around 5 Kb in size (when gzip compression is enabled), that’s not what’s causing the browser to take 450ms to load. It’s the REST API request it makes that may take time to return a response.

    In plain terms, it’s the time it takes for your server to return a response to the script what makes it seem like the browser is needing 450ms (in your case) to process wpp.min.js.

    Can it be deferred? Yes, however I don’t recommend it unless you don’t care about iOS / macOS visitors. In that case you could use the wp_script_attributes filter hook to programmatically add the defer attribute to the script (here’s an example that may help get you on the right track.)

    I would take a different approach: make sure that the REST API on your site responds as quickly as possible by improving anything server side that could be improved, including but not limited to: slow database queries, database optimization, object caching (usually not available on shared hosting plans), reviewing plugins / scripts to make your site as lean a possible by getting rid of code that’s no longer used / necessary, etc.

    Thread Starter Jim Reekes

    (@reekes)

    It’s the REST API request it makes that may take time to return a response

    Ah, that makes sense. I couldn’t think of how the JS was taking this long.

    I’ve already done as much as I can think of to improve performance, across the entire site (e.g. db optimizations, caching, Autoptimize, and leaning out plugins and my own code). If I can write the code myself I do, rather than install more plugins.

    I think I’m down to bottoming out with my hosting service ??

    My own experience is the site is fast, even on mobile. But Google’s Page Insights doesn’t seem to like it all that much. I’m struggling to get the mobile performance score into the 80s. (all my other scores are in the high 90s or even a solid 100) LCP on a block of text (!) can take >4 seconds on mobile. I think the biggest indicator of my hosting service is the TTFB number of 2.5 seconds.

    • This reply was modified 1 month, 3 weeks ago by Jim Reekes.
    Plugin Author Hector Cabrera

    (@hcabrera)

    LCP issues due to a block of text is indeed strange (this is off-topic but I’ll allow it for a bit haha). Is that text being loaded via AJAX or something like that? Because otherwise I don’t see how it would cause LCP issues. Well, maybe if you’re loading a whole bunch of font files (font files for specific font weights, font files for different font faces, etc.) and the browser is just taking long to load them all?

    Thread Starter Jim Reekes

    (@reekes)

    LCP issues due to a block of text is indeed strange

    Right. I’ve been chasing this mystery for months. In fact that’s what led me to use WPP! (moved off Top 10)

    It’s any text coming from the WP editor. Nothing unusual. If the block above the fold happens to be an image, then the LCP is the image. I think this is due to render blocking in general (which is why I asked about WPP).

    I only have two font families, in a couple styles/weights, and they’re hosted locally (and preloaded).

    At this point I’m willing to hire someone to help solve this. I’m at my wits end.

    Plugin Author Hector Cabrera

    (@hcabrera)

    At this point I’m willing to hire someone to help solve this. I’m at my wits end.

    Oh, I know that feeling haha. If it’s nothing urgent maybe taking a break from it for a little while might help (eg. work on something else or just take a break from the project). It’s very easy to burn yourself out when you can’t seem to find the solution to something right away, especially when it’s something that feels like should be trivial to fix.

    If it’s urgent though then yeah, getting another set of eyeballs on the problem may be the better choice.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.