#58213 closed enhancement (fixed)
Increase default for `wp_omit_loading_attr_threshold` to 3
Reported by: | flixos90 | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 6.3 | Priority: | high |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch, has-unit-tests, has-dev-note |
Focuses: | performance | Cc: |
Description
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.
Attachments (1)
Change History (11)
#1
@
17 months ago
- Priority changed from normal to high
Addressing the remaining lazy-loading related performance issues is a high priority for the performance team for the 6.3 cycle.
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
17 months ago
This ticket was mentioned in PR #4428 on WordPress/wordpress-develop by kt-12.
17 months ago
#3
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
Trac ticket: https://core.trac.wordpress.org/ticket/58213
Increase wp_omit_loading_attr_threshold
threshold to 3
16 months ago
#4
@felixarntz This is good for review. I have fixed both the test error (here) by using wp_omit_loading_attr_threshold
filter.
#5
@
16 months ago
- Keywords commit added
- Owner set to flixos90
- Status changed from new to assigned
Marking as ready to commit and assigning to @flixos90 to commit.
@flixos90 commented on PR #4428:
16 months ago
#7
Committed in https://core.trac.wordpress.org/changeset/55816 🎉
HTTP Archive data screenshot for how many sites have a given number of LCP candidates