hi Dalan,
Yes. You could create a bug and assign to me (or to component Blink>Loader>LazyLoad).
Alternately, you could report the URLs here in the comments too.
I gave this a try and it's not doing what I'm expecting, or maybe I misunderstand the feature.
Chrome Canary 70, with chrome://flags/#enable-lazy-image-loading enabled. I open this page in responsive mode in dev tools (iPhone 5):
https://www.eon.earth/
Next I monitor requests in the network panel. Without any scrolling, all images on the entire page are loaded over the network, whilst I explicitly set lazyload="on" on the images in the main grid of the page.
I do get the [intervention] message in the console:
[Intervention] Images loaded lazily and replaced with placeholders. Load events are deferred. See https://crbug.com/846170
What I would have expected is that images way down the page aren't loaded until I scroll close to them, but this doesn't seem to be happening. Am I missing something?
Hi Ferdy,
That particular website (https://www.eon.earth/) uses service-workers, and the images are fetched by the service-worker. These fetches would not be lazyloaded.
The behavior I see is that, the first time the page is loaded (when there is no cache and service-worker not installed) the images are lazy loaded.
Subsequent loads generally get the image from service-worker and it seems to come instantly from its cache.
Thanks for looking into this. I do have some follow-up questions.
The site does use a serviceworker, yet all that sw does is to cache an offline page, all other requests are simply passed through. So there is no sw cache for images.
On a side note, I wonder if what the network panel says is correct. It says "from serviceworker" for pretty much all requests, but that's not what happens. Yes, these requests pass through the sw, but the request itself still comes from the network, but this is not reported as such in the network panel.
I'm also not able to reproduce the lazy loading with cache disabled and the serviceworker uninstalled? How do you do it exactly?
My thinking is that lazy loading and sw should be unrelated. With lazy loading, the browser intelligently decides the trigger to request the resource. Whether that resources comes from a sw or cache shouldn't matter?
I found one question, if the image request donn't have the StrongValidator then the first partial content(0-2047) will not be reused. so this will take a waste?
@rajendrant: thanks so much for your detailed investigation, much appreciated! The results you show make me even more excited about this feature, so I'm really curious as to which part of the sw is interfering with it.
Comment 1 by rajendrant@chromium.org
, May 24 2018