Live data from Hacker News

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

groups.google.com

11–20 of 69 posts

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

#11

How is this only now getting implemented? I’m very surprised. Also, do we yet unload images (from memory) after a user scrolls far past them? I’m always surprised how slow “long” webpages become.

> do we yet unload images (from memory) after a user scrolls far past them?

Last time I looked, the answer was no for images but yes for background images. I implemented a lazy-loader which did the latter for a pretty significant measured improvement on gallery pages.

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

#12
The downside of this is that it assumes that I am always online, and I can never know if a page has finished loading. Say I load an article in a background tab to read later, then go somewhere without WiFi like, say, an airplane. I read the first page, hit the space bar, and see gray boxes. Now I need to either scroll all the way through any article I want to read later (unless "infinite scroll" happens), or save it as a web archive (if that even still works).

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

#14

The downside of this is that it assumes that I am always online, and I can never know if a page has finished loading. Say I load an article in a background tab to read later, then go somewhere without WiFi like, say, an airplane. I read the first page, hit the space bar, and see gray boxes. Now I need to either scroll all the way through any article I want to read later (unless "infinite scroll" happens), or save it…

Tons of web pages (especially e-commerce sites where initial visible page load time is critical) already do this, just with more complicated code.

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

#16

The downside of this is that it assumes that I am always online, and I can never know if a page has finished loading. Say I load an article in a background tab to read later, then go somewhere without WiFi like, say, an airplane. I read the first page, hit the space bar, and see gray boxes. Now I need to either scroll all the way through any article I want to read later (unless "infinite scroll" happens), or save it…

Tons of web pages (especially e-commerce sites where initial visible page load time is critical) already do this, just with more complicated code.

And mobile browsers randomly purge and reload pages when they're low on memory, and news sites do lazy image loading with miscellaneous Javascript. It all sucks, and it's too bad that Google wants to (i.e. will) "make it official."

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

#17
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…

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?

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

#18
post #5

How will this affect analytics with tracking pixels, etc?

I think that this could be a boon to pixel tracking. From my understanding, a site could embed multiple tracking pixels on a page to give a good approximation of how far the user scrolls and how long it takes them to scroll down the page, all without JavaScript.

I would be curious if this would also be apply to email clients that render using Chrome.

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

#19

The downside of this is that it assumes that I am always online, and I can never know if a page has finished loading. Say I load an article in a background tab to read later, then go somewhere without WiFi like, say, an airplane. I read the first page, hit the space bar, and see gray boxes. Now I need to either scroll all the way through any article I want to read later (unless "infinite scroll" happens), or save it…

This hardly ever works even today. If you want to know it will be available while offline you have to hit the save page button.

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

#20

Earlier quoted context omitted.

Tons of web pages (especially e-commerce sites where initial visible page load time is critical) already do this, just with more complicated code.

And mobile browsers randomly purge and reload pages when they're low on memory, and news sites do lazy image loading with miscellaneous Javascript. It all sucks, and it's too bad that Google wants to (i.e. will) "make it official."

You think this sucks? So instead of optimizing for the 99% case where I go to a site and want to see the images on the page as fast as possible and defer loading what I can't see initially, you instead want to prioritize "Say I load an article in a background tab to read later, then go somewhere without WiFi like, say, an airplane."???

Thanks, I'll take Google's solution.

Post reply on HN