rrit
(Ayke)
January 14, 2022, 11:38pm
1
Can we exclude the user-agent “Chrome-Lighthouse” from crawlers and thereby show Lighthouse the real application view?
discourse:main
← rr-it:dev/measure-perf-lighthouse-crawler
opened 11:24PM - 14 Jan 22 UTC
Exclude user-agent Chrome-Lighthouse from crawlers and show it the real applicat… ion view.
This enables [Lightouse](https://github.com/GoogleChrome/lighthouse) in Chrome DevTools and [PageSpeed Insights](https://pagespeed.web.dev/) to measure the performance of Discourse like viewed by an user.
Until now Lighthouse measured the performance for an user-device which is rendering the crawler-layout - this never happens in reality.
Application-view performance
This enables Lightouse in Chrome DevTools and PageSpeed Insights to measure the performance of Discourse like viewed by an user.
Crawler-view performance
Until now Lighthouse measured the performance for an user-device which is rendering the crawler-layout - this never happens in reality.
When they run those lighthose performance tests on a recent iPhone model (even an iPhone 8 or later), I am open to this. Right now android performance is 3x (or more) slower than iPhone unfortunately.
Check your device at Speedometer 2.0 to see what I mean – this measures JavaScript performance in the browser:
Until they run lighthouse on an iPhone (any model) for context, I am absolutely opposed to any change here. When they do, I will happily accept the PR, with gusto.
2 Likes
rrit
(Ayke)
January 14, 2022, 11:58pm
3
For their metrics they are already collecting “real-user experience data” (CrUX dataset ) from ~200 EUR/USD Android phones running Chrome - and this data gets into the Core Web Vitals report on Google Search Console .
How about putting this behind a flag or enable it for development environments only?
Falco
(Falco)
January 15, 2022, 12:08am
4
You can run lighthouse with a custom user agent from your machine to get the SPA perf numbers.
4 Likes
rrit
(Ayke)
January 16, 2022, 3:10pm
5
For this solution to measure the intended Discourse view:
mobile-view: add ?mobile_view=1
to the url
desktop-view: add ?mobile_view=0
to the url
This setting is remembered in LocalStorage. So reset it once if necessary:
Add ?mobile_view=auto
to the url.
1 Like