Consider mechanism for persisting element data even when their original URL Metrics expire #1891
Labels
Needs Discussion
Anything that needs a discussion/agreement
[Plugin] Optimization Detective
Issues for the Optimization Detective plugin
As described in #1847:
Embed Optimizer adds a
resizedBoundingClientRect
property to the element schema. This gets populated by a client-side extension when a Resize Observer detects an embed resize. Nevertheless, embeds outside the viewport are lazy-loaded. This means that if URL Metrics are collected by visitors who never scroll down the page, then thisresizedBoundingClientRect
property will not get populated. And even if it does eventually get populated in a URL Metric, when new URL Metrics are collected then theresizedBoundingClientRect
will get lost as the new fresher URL Metrics displace the stale ones. Granted, this is not a big deal for embeds because if the embed is outside the viewport the first place so that it can be lazy-loaded, then there's likely not going to by any layout shift appearing to the user and thus no impact on CLS. The issue is more important for applying Content Visibility (as quoted above) since the heights of elements outside the viewport need to be set up-front in order to prevent scrollbar jank.The Content Visibility plugin (as prototype to implement #1308), referenced above, solves the problem by persisting element data in the postmeta for the
od_url_metrics
post type. This works, but is it the best?The text was updated successfully, but these errors were encountered: