GoogleChrome / web-vitals

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

[Question] Why is FCP not an attribution for LCP? #406

Closed williazz closed 10 months ago

williazz commented 11 months ago

The "Optimize Largest Contentful Paint" article by web.dev states:

A large delta between FCP and LCP indicates that the LCP resource is either not immediately available for the browser to prioritize (for example, text or images that are managed by JavaScript rather than being available in the initial HTML), or that the browser is completing other work before it can display the LCP content.

So why is FCP not packaged as an LCP attribution? It seems very useful and relevant.

philipwalton commented 11 months ago

So why is FCP not packaged as an LCP attribution? It seems very useful and relevant.

The reason is because the current LCP breakdown metrics actually provide more information than FCP provides, so it makes more sense to use them.

FCP is a useful metric if you want to optimize for a fast first paint, but if you are only wanting to Optimize LCP then FCP may or may not be helpful as an attribution signal. For example, if you have a page with a render-blocking stylesheet, that will likely delay FCP but (depending on the size of the stylesheet) it may or may not have any impact on LCP.

williazz commented 10 months ago

Thanks! FCP is not always relevant to LCP, so it's not an LCP attribution.

FCP is a useful metric if you want to optimize for a fast first paint

Should FP also be an attribution for FCP then?

philipwalton commented 10 months ago

Should FP also be an attribution for FCP then?

The vast majority of the time, FP and FCP end up being the exact same time, so in general FP is not useful as a diagnostic metric for FCP.

williazz commented 10 months ago

Sounds good. Thanks