Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance test is finished in the middle of page load (waiting for an XHR) #11639

Closed
benshabatnoam opened this issue Nov 9, 2020 · 6 comments · Fixed by #11738
Closed

Performance test is finished in the middle of page load (waiting for an XHR) #11639

benshabatnoam opened this issue Nov 9, 2020 · 6 comments · Fixed by #11738
Assignees

Comments

@benshabatnoam
Copy link

benshabatnoam commented Nov 9, 2020

Hello there,

I'm running an Angular version performance test with lighthouse/page speed insights, and some of these tests are finishing prematurely (in the middle of the page loading), in a phase where the site is waiting for the main page content to arrive from an http request.

What is the current behavior?

Running the LH over my (Angular) website, sometimes (most of the times) finishing the test prematurely.
From performance tab I can see that there are 3 phases of the page load which are:

  1. Angular bootstrap
  2. My component (page component) initialize.
    In this init phase I'm sending a request to the backend to get the page data.
    This is where LH finishing the test at, while the site is waiting for this api call to response.
  3. Render the page content accordingly to the page data that we got from the request.

What is the expected behavior?

I would expect that LH will wait for my request to finish before it determent that the page load was done.

Environment Information

  • DevTools
  • Lighthouse version: 6.2.0
  • Chrome version: 86.0.4240.183 (Official Build) (64-bit) (cohort: Stable)
  • Node.js version: 14.3.0
  • Operating System: Windows 10

Thanks a lot for LH tool, it is awesome!
I'll appreciate your help on this one,
Noam

@patrickhulce
Copy link
Collaborator

patrickhulce commented Nov 9, 2020

Thanks for filing @benshabatnoam!

This happens due to the limited wait time for Lighthouse by default in simulated mode. As a temporary workaround you can try unchecking the "Simulated throttling" checkbox in DevTools or run from the CLI with --throttlingMethod=devtools.

Related #11180

Lighthouse team: my current idea for this is to wait for network-0-quiet for the first 10 or so seconds and then wait for network-2-quiet in addition to waiting for high priority images to solve #11180.


edit after team discussion: we do this proposal plus folding in request priority as a signal (XHRs and foreground images are high priority)

@patrickhulce patrickhulce changed the title Performance test is finished in the middle of page load (waiting for an http response) Performance test is finished in the middle of page load (waiting for an XHR) Nov 9, 2020
@benshabatnoam
Copy link
Author

Thank you for your quick reply, I'll definitely try your suggested workaround.

I do have a couple of questions that I'm concerned about this bug, maybe you can help me figure out:

  1. Is there a workaround for this for our JS code? as we do want the page speed insights (PSI) test to show our real score.
  2. Most important question - does PSI not giving a score due to this bug cause any issues with Google search, indexing and ranking?

Thanks a lot for your help

@patrickhulce
Copy link
Collaborator

as we do want the page speed insights (PSI) test to show our real score.

There isn't a workaround for PSI in this case. It will need to be fixed on the Lighthouse side.

Most important question - does PSI not giving a score due to this bug cause any issues with Google search, indexing and ranking?

I don't know the answer to this, but doesn't this bug cause PSI to give a higher score than it should? :)

@benshabatnoam
Copy link
Author

Yes; PSI does give a false higher score, which is wrong. Could this cause issues with search rankings by artificially giving a speed boost? In other words, I am trying to understand if PSI scores are an influencing factor in site ranking.

@patrickhulce
Copy link
Collaborator

I understand. That's the question for which I don't have an answer, you'll have to ask search :)

@benshabatnoam
Copy link
Author

OK. Thanks a lot for all your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants