question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Page Speed Insights Ignores CloudFlare's Rocket Loader

See original GitHub issue

Cloudflare has a tool for website’s dubbed the Rocket Loader. Doc: https://support.cloudflare.com/hc/en-us/articles/200168056-What-does-Rocket-Loader-do-

The tool effectively will optimize the website by renaming all <script> related tags to something like the following.

<script src='/wp-includes/js/jquery/jquery.js' type="text/javascript"></script> to the following

<script src='/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp' type="4906178bed34d3d402cc70b3-text/javascript"></script> It also rewrites inline scripts so the opening <script> tag is rewritten to something like: <script type="4906178bed34d3d402cc70b3-text/javascript"> The concept is quite simple all the JS on the page is effectively deferred including inline JS. This is particularly useful when an application has an in-line script that is dependent on another file loading in a render-blocking fashion.

However, Page Speed Insights ignores this completely.

For instance on my domain: https://www.sertmedia.com/

You can run a test using Page Speed Insights and it will get flagged as JQuery being render-blocking. image

However, if you run the same test in Lighthouse (on Chrome Canary) image

It is properly detected as no longer being render-blocking. The issue, of course, is this can have a fairly drastic impact on performance between lighthouse local and page speed insights. Also, I tested the site on web.dev as well just for reference and it acts the same as page speed insights.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

9reactions
sejokercommented, Jun 19, 2020

We are planing to allow Page Speed Insights to run RocketLoader.

5reactions
sejokercommented, Oct 1, 2020

We are planing to allow Page Speed Insights to run RocketLoader.

Any news on a time line?

Rocket Loader should run during Page Speed Insights testing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rocket Loader and PageSpeed Insights - Performance
Hi, I have Rocket Loader enabled and in Google PageSpeed Insights under 'Avoid long main-thread tasks', the ajax Rocket Loader script ...
Read more >
PostScribe and Rocket Loader - Performance
Learn how Rocket Loader ignores specific Javascripts.OverviewYou can have Rocket Loader ignore individual scripts by adding the data-cfasync=" ...
Read more >
Rocket Loader · Cloudflare Fundamentals docs
Rocket Loader prioritizes your website's content (text, images, fonts, and more) by deferring the loading of all of your JavaScript until ...
Read more >
CloudFlare Rocket Loader Disables It's Self On Page ...
A client site I am working on gets a 65-70 on lighthouse in chrome canary but gets a 40 in Page Speed Insights...
Read more >
Page speed latency due to Rocket Loader - Performance
So if RocketLoader does block rendering the page for a long time this means there is much to do, much to improve. Just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found