GET_LCP_LAZY function
The httparchive.fn.GET_LCP_LAZY
function returns whether the LCP element had native and/or custom lazy-loading attributes.
Input
performance_custom_metric
The JSON-encoded performance
custom metric of a page.
Type: STRING
Output
Lazy-loading information about the LCP element.
If the LCP element had native lazy-loading, the native
property will be true
.
If the LCP element had custom lazy-loading, the custom
property will be an array of CSS selectors representing the techniques used, which can be any of:
[data-src]
[data-rimg]
[data-lazy]
[class~=lazyload]
[class~=swiper-lazy]
For custom attributes, only the name needs to match (the value is ignored). For custom classes, the value must exist anywhere in the attribute separated by whitespace.
Type: STRUCT<native BOOL, custom ARRAY<STRING>>
Example usage
Percent of pages that natively lazy load their LCP element
pct_lazy |
---|
0.039 |
Top custom lazy-loading techniques
custom_technique.value | custom_technique.count |
---|---|
[data-src] | 585469 |
[data-rimg]` | 12434 |
[class~=lazyload] | 6497 |
[data-lazy] | 4490 |
[class~=swiper-lazy] | 553 |