Live data from Hacker News

Chrome to get lazy load below-the-fold images and iframes

groups.google.com

41–50 of 69 posts

Re: Chrome to get lazy load below-the-fold images and iframes

#41

Why they say they are pushing this: * "Speed up the load of above-the-fold content, since there will be less competition for network resources during the initial page load" Why don't they just set a low priority for offscreen images and resources? Isn't this the entire premise for HTTP/2, that multiplexing with priorities and flow control would load the important data first? Do servers not implement the spec correctl…

No, commodity phones in developing countries do not come with massive memories. Memory is the biggest issue for those.

No, most phones do not have unlimited data at all.

I am not even starting with your conspiracy theory.

I am pretty sure when Chromium engineers look at same data for these decisions, but hey, maybe you have some numbers to share.

Re: Chrome to get lazy load below-the-fold images and iframes

#42
post #38

Why they say they are pushing this: * "Speed up the load of above-the-fold content, since there will be less competition for network resources during the initial page load" Why don't they just set a low priority for offscreen images and resources? Isn't this the entire premise for HTTP/2, that multiplexing with priorities and flow control would load the important data first? Do servers not implement the spec correctl…

Wow, how can this conspiracy-theory-like nonsense be voted to the top of the comments? I thought Hacker News was a rational place. The reality is that lazy loading images really does help webpage performance, especially on mobile. You cannot properly implement it in the browser without additional information from the page developer - because you'll never know which images are so important that they will always need t…

No we're talking about every website having to make this work because the default is to not require loading the resources or else be blamed for not being compliant with a spec forced on them by Google through their browser monopoly.

Google should need some really good evidence to support this.

What points do you disagree with, and why? Where are the metrics? If it's better performing than just priorities and flow control then by how much, and how do you justify breaking sites to achieve that margin?

Re: Chrome to get lazy load below-the-fold images and iframes

#43
post #4

This feature seems to be involved. In order to layout the html page you need to know the image sizes(unless they are explicit), and for that you still need to download the image header, and the headers are of different sizes for different returned image formats. And some images change when you load them second time. So it seems the only way to correctly implement that is to open a connection to load an image and stal…

Well, if you want to implement it optimally then you need to be doing srcsets and the easiest way to do them is to put the img width and height in the tag. Then run mod_pagespeed to tidy up the html. It then creates the srceset images. It will not be a solution to everyone's taste but it abstracts out the srcset bit to the server so you can have clean markup. If you are caching your pages at some level then it isn't going to be looking up image dimensions too often. Plus looking up image dimensions server side is a simple ask, no network needed.

I am going with the explicit image dimensions, srcsets and no lazy loading, which happens to be a feature of mod_pagespeed. With figure elements or picture elements for the content images, populated with the srcsets, I see this new browser side lazyload as the missing feature needed to preserve document structure, not have any javascript cludges and serve images in a way that respects data saving and viewport size.

Time to add the new 'lazy' attribute. Firefox and Safari users might not benefit yet but this is no need to wait.

Re: Chrome to get lazy load below-the-fold images and iframes

#44

Earlier quoted context omitted.

There's a link explaining how it's done! It tries things in this order: 1. If the full image is present and fresh in the cache, then use that. 2. Otherwise, if the server supports range requests, and the image dimensions can be decoded from the first 2KB of the image, then generate and show an image placeholder with the same dimensions. 3. Otherwise, fetch the entire full image from the server as usual. So, it'll onl…

Why does it download the 2kb if the image dimensions are specified?

the spec says "[…] the image dimensions can be decoded from the first 2KB of the image".

It doesn't say anything about when the dimensions are known and I would assume it's using those in that case.

However, loading 2KB of an image is enough for most image formats to determine the dimensions even if they aren't specified in the hosting document (because most image formats contain a header specifying dimensions).

Re: Chrome to get lazy load below-the-fold images and iframes

#45

Earlier quoted context omitted.

You seem to be missing a few things: - data usage is correlated with battery usage, which is important on mobile - the http2 prioritization point is only half valid. Two big assumptions that probably don't hold in practice: whether the implementations actually implement priority correctly, all the way through the stack (e.g. perhaps some servers have a suboptimal implementation?), And whether having a bazillion low p…

Their own customers are using less than 15 GB per month, how much battery could they possibly save on the radio? A single video will use more radio time than days of image downloads in the browser. Furthermore, Google themselves didn't mention battery savings but just fewer bytes sent. And what delicious irony if they couldn't solve this with HTTP/2 because of servers not implementing the spec correctly or having wei…

My previous phone - an HTC one m7 - had some battery issues when it was pretty new. I limited myself to something like 2 or 3gb per month on cellular data (because that was my plan) and yet I still had to charge my phone at work somedays. (It's not about battery over the whole month - it's about the worst case on any given day.)

I learned to debug by looking at the system data usage monitors - the standard power usage per app wasn't helpful. Turned out the problem was just a data hungry photo app we were developing at the time. We made it nicer on data usage before we launched.

And after all that, chrome was usually in my top 3 apps for data usage. Probably still is. So they absolutely should be optimizing it.

Granted that was several years ago but in some parts of the world that phone would probably be better then what the average consumer uses today.

Re: Chrome to get lazy load below-the-fold images and iframes

#46

Why they say they are pushing this: * "Speed up the load of above-the-fold content, since there will be less competition for network resources during the initial page load" Why don't they just set a low priority for offscreen images and resources? Isn't this the entire premise for HTTP/2, that multiplexing with priorities and flow control would load the important data first? Do servers not implement the spec correctl…

> Most phone plans are unlimited or have data capable of watching movies.

On what do you base this claim? My experience is the opposite - most people I know have less than 3GB/month. Do you have any actual data?

Re: Chrome to get lazy load below-the-fold images and iframes

#48

The post says "Firefox: No public signals" - does that mean there is no word from Firefox if it'll be implemented in Firefox?

There is an open Firefox bug about it:

https://bugzilla.mozilla.org/show_bug.cgi?id=1535749

But the last comment raises concerns about privacy implications it may have. So, I think that right now it is unclear whether Firefox will eventually implement it and in what form.

Re: Chrome to get lazy load below-the-fold images and iframes

#50
post #49
post #28

No need to rely on IntersectionObserver() or even for JavaScript to be enabled -- Adtech vendors (like Google) can now detect scroll position server-side!

What? As far as I know this feature is completely client-side.

The server will know how far you scrolled in a session by what images/iframes are being downloaded.
Post reply on HN