GoogleChrome / web-vitals

Essential metrics for a healthy site.
https://web.dev/vitals
Apache License 2.0
7.49k stars 410 forks source link

How does page speed collect LCP value when there is no timing-allow-origin? #373

Closed xiaofud closed 1 year ago

xiaofud commented 1 year ago

If the image resource has no timing-allow-origin header, will the LCP value be the loadTime or does page speed have its way to get renderTime?

tunetheweb commented 1 year ago

No we only have the loadTime, which can lead to some issues like https://github.com/GoogleChrome/web-vitals/issues/369#issuecomment-1636820858

tunetheweb commented 1 year ago

Note that the Chrome User Experience Report (CrUX) does not have this constraint and so the CrUX data surfaced in tools like PageSpeed Insights will have the correct LCP time.

This is one difference between CrUX and RUM (including web-vital.js): https://web.dev/crux-and-rum-differences/#cross-origin-resources

xiaofud commented 1 year ago

Note that the Chrome User Experience Report (CrUX) does not have this constraint and so the CrUX data surfaced in tools like PageSpeed Insights will have the correct LCP time.

This is one difference between CrUX and RUM (including web-vital.js): https://web.dev/crux-and-rum-differences/#cross-origin-resources

Thanks! The page you provided is helpful.