[wp-trac] [WordPress Trac] #44427: Introduce lazy-loading API for media and other elements

WordPress Trac noreply at wordpress.org
Thu Aug 8 12:25:11 UTC 2019


#44427: Introduce lazy-loading API for media and other elements
------------------------------------------+------------------------------
 Reporter:  mor10                         |       Owner:  (none)
     Type:  feature request               |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Media                         |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  performance
------------------------------------------+------------------------------

Comment (by JakePT):

 In all these discussions of lazy loading I don't see anyone considering
 that lazy loading on a slow connection makes for an absolutely abysmal
 browsing experience. Has no one browsed the web on a slow connection
 before? If I'm loading a long-ish article with images on a slow
 connection, then I want those images to start loading immediately so that
 they're visible by the time that I get to them. If lazy loading is
 enabled, or starts loading images too late, then the user is forced to
 stop and wait for the image to load each time they reach one. It's the
 equivalent of these web video players that only buffer a small amount of
 the video. When I had a poor connection in the past there were sites whose
 videos I could not watch at all (ever) because it was impossible to let
 the video load. This is a similar issue. It saves the site owner
 bandwidth, but makes browsing/watching utterly miserable.

 I'd also like somebody to actually articulate what the performance
 benefits for lazy loading actually are before anything is done. This
 ticket and the Google article go on about performance, performance,
 performance, but with no real data. Obviously without lazy loading the
 page isn't considered fully loaded until all the images are loaded, which
 means that a page with lazy loading would be considered "fully loaded"
 sooner, but is that meaningful? One could argue that by that metric a page
 with lazy loaded images isn't truly fully loaded until I scroll to the
 bottom to cause all the images to load. Does the browser loading images
 below the fold actually significantly affect time to interactive? Does
 that outweigh the user experience costs I've described? We're seeing
 browsers and libraries specifically designed to pre-load entire webpages
 in the background so that when the user clicks a link they perceive the
 next page to have loaded instantly, but we're simultaneously seeing
 efforts to prevent content ''on the same page'' from being pre-loaded,
 also in the name of performance. How does that make sense?

 Google themselves say:

 >Today, Chrome already loads images at different priorities depending on
 where they're located with respect to the device viewport. Images below
 the viewport are loaded with a lower priority, but they're still fetched
 as soon as possible.

 Is that not already sufficient for perceived performance? How does lazy
 loading improve ''performance'' over that?

 So my argument is that while lazy loading might help with bandwidth and
 memory usage, which is not meaningless, it is a considerably poorer user
 experience for anyone that is not on a high speed connection. As such I
 believe that any application of lazy loading needs to carefully consider
 which images it's used for, and that this is highly dependent on context
 and not a decision that WordPress should be making bluntly for all sites
 like this. If even Google believed that lazy loading was preferable for
 all (or even most) contexts, they would have made it the default browser
 behaviour for loading images. So why should WordPress make this behaviour
 the default? I believe that at ''most'' WordPress should add a checkbox
 for enabling lazy loading to the image insert/edit modals.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44427#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list