wordpresspagespeed-insights

Page speed scans site multiple times


PageSpeed Insight scaning my site twice. I have asked in wordpress and my theme forums they said its not a bug.

I have deleted cookies and page cache from server and wp rocket. The only plugins activated are yoast,wp rocket and imagfy. I have reinstalled all.and still see the same result.

Here is the screenshot and this is the website

Any idea why ?


Solution

  • That audit is not saying it's loading the same resource twice. It's saying that JavaScript file is causing two long tasks:

    English screenshot of the audit

    The same JavaScript file can create many long tasks. For example it might execute several bits of slow JavaScript. Or the same bit of slow JavaScript every so often.

    Other audits (for example the "JavaScript Execution time" audit) show the total per script:

    JavaScript Execution time

    You can get more details if you run a Lighthouse trace in DevTools and use DevTools throttling:

    DevTools throttling

    You will see it similarly shows a number (4 this time) long tasks:

    4 long tasks

    And then click on View Trace:

    View Treemap and View Trace buttons

    it will load the trace in the Performance Panel:

    View Trace with 4 long tasks

    There are indeed 4 long tasks (as shown with the red triangles). You can dig into this more there.