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
- 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:
What is the expected behavior?
I’m already using preconnect
for both these origins:
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
- No crossorigin on Google Analytics preconnect https://github.com/GoogleChrome/lighthouse/issues/5932#issuecomment-445379233 — committed to nhoizey/nicolas-hoizey.com by nhoizey 4 years ago
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:
I have some
preconnect
link
’s in the HTML:But Lighthouse is suggesting I add them:
@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/