> All in One 586: Native Image Lazy Loading in Chrome Is Way Too Eager

Ads

Wednesday, February 5, 2020

Native Image Lazy Loading in Chrome Is Way Too Eager

Interesting research from Aaron Peters on <img loading="lazy" ... >:

On my 13 inch macbook, with Dock positioned on the left, the viewport height in Chrome is 786 pixels so images with loading="lazy" that are more than 4x the viewport down the page are eagerly fetched by Chrome on page load.

In my opinion, that is waaaaay too eager. Why not use a lower threshold value like 1000 pixels? Or even better: base the threshold value on the actual viewport height.

My guess is they chose not to over-engineer the feature by default and will improve it over time. By choosing a fairly high threshold, they ran a lower risk of it annoying users with layout shifts on pages with images that don't use width/height attributes.

I think this unmerged Pull Request is the closest thing we have to a spec and it uses language like "scrolled into the viewport" which suggests no threshold at all.

Direct Link to ArticlePermalink

The post Native Image Lazy Loading in Chrome Is Way Too Eager appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2QhLfce
via IFTTT

No comments:

Post a Comment

Partly Cloudy today!

With a high of F and a low of 20F. Currently, it's 26F and Fair outside. Current wind speeds: 8 from the Northwest Pollen: 0 Sun...