[wp-trac] [WordPress Trac] #58213: Increase default for `wp_omit_loading_attr_threshold` to 3
WordPress Trac
noreply at wordpress.org
Thu Apr 27 21:22:02 UTC 2023
#58213: Increase default for `wp_omit_loading_attr_threshold` to 3
-------------------------+------------------------------------------
Reporter: flixos90 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.3
Component: Media | Version:
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: performance |
-------------------------+------------------------------------------
The current default threshold for how many content images to skip lazy-
loading on (which is just 1) has proven to be too strict: Many sites have
more than 1 large image and potential LCP candidate visible above the
fold, and due to the very conservative threshold here, those sites may end
up lazy-loading their LCP image which negatively affects load time
performance.
Based on HTTP Archive data queried to get a better idea of this (see
attached screenshot), a reasonable default value for the filter would be
3. >70% of sites have up to 3 equal-sized images in the initial viewport,
each of which ''could'' be the LCP image and therefore should not be lazy-
loaded. Sites that have fewer than 3 images above the fold will not see a
negative performance impact, they will only lose out on 1-2 images that
may otherwise have been lazy-loaded to be loaded immediately, which is an
acceptable tradeoff to get faster overall load time performance.
While we could of course increase the default to even a higher number, the
% of sites that use a specific number greater than 3 is much lower, e.g.
to cover 80% of sites in total, the default threshold would need to be set
to 8, which is excessive and would reduce the lazy-loading benefits too
much for the majority of sites.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58213>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list