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

when url redirects, requests with no parent are attributed to original url in CRC report #483

Closed
brendankenny opened this issue Jun 29, 2016 · 3 comments · Fixed by #488
Closed
Assignees

Comments

@brendankenny
Copy link
Member

and if 'about:blank' somehow sneaks in there, the CriticalRequestChains formatter throws.

Simple example is node lighthouse-cli/index.js http://pwa.rocks (which redirects to https://pwa.rocks). I get this report (see last images/icon-228x228.png entry):

 -- Critical Request Chains: 7
    - Longest request chain (shorter is better): 3
    - Longest chain duration (shorter is better): 1593.34ms
    - Longest chain transfer size (smaller is better): 2.11KB
    - Initial navigation
      ┣━┳ / (pwa.rocks)
      ┃ ┗━┳ / (pwa.rocks)
      ┃   ┣━━ styles/screen.css (pwa.rocks) - 1122.55ms, 0.24KB
      ┃   ┣━━ fonts/permanent-marker.woff (pwa.rocks) - 1174.97ms, 0.24KB
      ┃   ┣━━ images/currency-x.svg (pwa.rocks) - 1179.77ms, 0.24KB
      ┃   ┣━━ images/datememe.svg (pwa.rocks) - 1183.23ms, 0.24KB
      ┃   ┣━━ images/flipboard.svg (pwa.rocks) - 1186.40ms, 0.24KB
      ┃   ┗━━ images/get-kana.svg (pwa.rocks) - 1189.66ms, 0.24KB
      ┗━━ images/icon-228x228.png (pwa.rocks) - 1593.34ms, 2.11KB

A bigger issue is node lighthouse-cli/index.js https://aliexpress.com, which redirects several times. The report:

 -- Critical Request Chains: 15
    - Longest request chain (shorter is better): 5
    - Longest chain duration (shorter is better): 2857.46ms
    - Longest chain transfer size (smaller is better): 6.88KB
    - Initial navigation
      ┣━┳ / (aliexpress.com)
      ┃ ┗━┳ / (www.aliexpress.com)
      ┃   ┗━┳ / (m.aliexpress.com)
      ┃     ┗━┳ / (m.aliexpress.com)
      ┃       ┣━━ atom/ (i.alicdn.com) - 1935.47ms, 9.57KB
      ┃       ┣━━ ae-mobile/ (i.alicdn.com) - 2060.81ms, 9.57KB
      ┃       ┣━━ ae-mobile/ (i.alicdn.com) - 2230.06ms, 9.57KB
      ┃       ┣━━ iconfont/iconfontmd.3cc462f0.ttf (i.alicdn.com) - 2240.84ms, 9.57KB
      ┃       ┣━━ kf/HTB1IUZ4HFXXXXaXapXX760XFXXXo.png (ae01.alicdn.com) - 2563.99ms, 9.57KB
      ┃       ┣━━ tps/TB1CRyiMFXXXXbRXXXXXXXXXXXX-152-152.png (ae01.alicdn.com) - 2564.42ms, 9.57KB
      ┃       ┣━━ tps/TB11NlRMFXXXXcYXVXXXXXXXXXX-152-152.png (ae01.alicdn.com) - 2564.74ms, 9.57KB
      ┃       ┣━━ tps/TB1noucMFXXXXbCXpXXXXXXXXXX-152-152.png (ae01.alicdn.com) - 2565.23ms, 9.57KB
      ┃       ┣━━ kf/HTB198AeHFXXXXX2apXX760XFXXXy.png (ae01.alicdn.com) - 2662.40ms, 9.57KB
      ┃       ┗━━ tps/TB1AedWJFXXXXa0aXXXXXXXXXXX-688-394.png (img.alicdn.com) - 2704.03ms, 9.57KB
      ┣━━ about:blank (blank) - 2536.77ms, 0.00KB
      ┣━━ kf/HTB1FLbfHFXXXXbkapXX760XFXXXs.png (ae01.alicdn.com) - 2618.91ms, 0.00KB
      ┣━━ kf/HTB1rKCOKXXXXXcHXFXXq6xXFXXXX.jpg_350x350.jpg (ae01.alicdn.com) - 2662.12ms, 0.00KB
      ┣━━ HTB18T9uLVXXXXXdaXXXq6xXFXXX1/32620605929.jpg (ae01.alicdn.com) - 2843.76ms, 0.00KB
      ┗━━ kf/HTB1jr57KFXXXXcwXXXXq6xXFXXXg.jpg (ae01.alicdn.com) - 2857.46ms, 0.00KB

the about:blank line is actually the bigger issue. No idea where that's coming from, and it's causing the CRC formatter to throw here, because url.parse('about:blank').path is null.

@brendankenny
Copy link
Member Author

adding @deepanjanroy in case you have time to figure out what's going on here

@deepanjanroy
Copy link
Contributor

About the first case - this issue is not specific to redirects. If you go directly to https://pwa.rocks, the request to the icon is still attributed to Initial Navigation. I'm tempted to say this is working as expected - favicons and icons are handled quite differently by the browser and is not directly initiated by the html document. For example, the browser will still request a favicon at the default url even if the html document doesn't mention it.

It is possible that there are other requests that have no parent because we have incomplete information, and which should not be attributed to the initial navigation. http://crbug.com/570298 is dealing with this issue and hopefully we won't have to fix anything on lighthouse side.

The about:blank in the second case is very strange and almost definitely a bug - I'm investigating.

@deepanjanroy
Copy link
Contributor

Looks like aliexpress is indeed navigating to about:blank for an iframe.

screenshot from 2016-06-29 11 34 58

Since this navigation is done by the page, it should show up on the critical request chain. The initiator of this request should probably be the js script that does the navigation - I'll make sure http://crbug.com/570298 is aware of this case. The url parsing code should be fixed so it can handle about:blank, since clearly webpages are allowed to make requests like this.

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

Successfully merging a pull request may close this issue.

2 participants