lighthouse: Audit: false positive for preconnect/dns-prefetch suggestion

OMG. Finally moved off tumblr.com for my blog! I built a dope site but want to make The House the happiest it can be.

I’m using `link rel=preconnect" for a couple of domains, but LH re-suggests that to me as an improvement :\

Provide the steps to reproduce

  1. Run LH 3.0.3 on https://ericbidelman.com

What is the current behavior?

Perf > Opportunities says that I should use dns-prefetch and/or connect to reduce RTTs to origins:

screen shot 2018-08-29 at 2 57 09 pm

What is the expected behavior?

I’m already using preconnect for both these origins:

screen shot 2018-08-29 at 2 57 21 pm

Not sure if the audit already does this, but we we could look at the DOM for link rel=preconnect|dns-prefetch and remove any origins users are already preconnecting to.

Environment Information

  • Lighthouse version: 3.0.3

Related issues

Report: https://googlechrome.github.io/lighthouse/viewer/?gist=4bd3bf89ce0ac69319db6cf1e9b94a83

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 8
  • Comments: 17

Commits related to this issue

Most upvoted comments

I think I’m seeing the same. The report has Lighthouse 4.0.0-alpha.1 at the top.

I’m using the Lighthouse Chrome ext:

ps3

I have some preconnect link’s in the HTML:

ps2

But Lighthouse is suggesting I add them:

ps1

@dawsbot in this WebPageTest result (https://webpagetest.org/result/200207_1J_c1f01a929bb96dde1265c14cd44ffd56/1/details/#waterfall_view_step1) without Lighthouse involved, those origins were not preconnected, so it would appear that Lighthouse is correctly flagging this situation. It’s worth noting that Chrome started ignoring preconnect directives in slow network conditions when there too many, so we’ve changed our advice to only preconnect to the 2 most important origins in the upcoming release of Lighthouse. I’d guess this is the situation we find ourselves in now and why Brave might be still preconnecting if it’s a Chrome-specific trial.

I’m able to reproduce this bug from the command line if i use --chrome-flags="--headless". When I run lighthouse in normal mode, it seems to preconnect normally.

hey @ebidel FYI I think LH might be right here, it looks like we don’t want the crossorigin attribute on the google-analytics preconnect, removing it starts properly connecting for me on a test page.

Without crossorigin https://www.webpagetest.org/result/181207_Z3_0bfcc9e3542a8c4f9dda1f9395e27268/1/details/

With crossorigin https://www.webpagetest.org/result/181207_H7_63d41425c12253f21a0963c2af5ca01b/1/details/