You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #878 (comment), the Image Loading Optimization module (see #869) has detection logic to discover the LCP image and other images which are in the initial viewport. This logic is currently running at the load event after which it immediately sends the data to the REST API endpoint:
However, given that the metrics collection is a low priority task which is intended to improve the user experience, we must guard against it from possibly impacting a visitor in a negative way when URL metrics need to gathered. For this reason there is the following todo:
We should leverage requestIdleCallback() and/or scheduler.yield() (or else setTimeout)--whatever is available--to make sure that the detection task is broken up into small tasks that do not contribute to a long task.
The text was updated successfully, but these errors were encountered:
Feature Description
As discussed in #878 (comment), the Image Loading Optimization module (see #869) has detection logic to discover the LCP image and other images which are in the initial viewport. This logic is currently running at the
load
event after which it immediately sends the data to the REST API endpoint:performance/modules/images/image-loading-optimization/detection/detect.js
Lines 342 to 433 in 03f3252
However, given that the metrics collection is a low priority task which is intended to improve the user experience, we must guard against it from possibly impacting a visitor in a negative way when URL metrics need to gathered. For this reason there is the following todo:
performance/modules/images/image-loading-optimization/detection/detect.js
Line 406 in 03f3252
We should leverage
requestIdleCallback()
and/orscheduler.yield()
(or elsesetTimeout
)--whatever is available--to make sure that the detection task is broken up into small tasks that do not contribute to a long task.The text was updated successfully, but these errors were encountered: