3 ms·
Regarding lazy image loading, I'm not a fan of these wholesale opinions that don't consider how varied our needs are. I'm showing a gallery of photo thumbnails
by slver 5y ago
Regarding lazy image loading, I'm not a fan of these wholesale opinions that don't consider how varied our needs are. I'm showing a gallery of photo thumbnails going back a decade.
I want to provide a smooth experience similar to how you'd watch your gallery on Android or iOS.
So this means no, I don't want to have the user click links with years and months on them, I want a single page.
But do I want to load literally THOUSANDS OF IMAGES at once? No.
I want to know where on the page I am, and load the visible images, and also few rows above the fold and few rows below the fold.
And I can do this with JS.
What's the lesson here? "They won't be loaded when you scroll anyway". They can be. "HTML is much better than JavaScript" sometimes (often) it isn't. "if you care about the image, you very probably shouldn’t use lazy loading on it; and if you don’t care about it, hey, why not just remove it?" Well, BS.
- chrismorgan 5y agoGenerally speaking, I said. And “very probably”. Certainly there are situations where you need to control the loading behaviour, but for typical scrolling content—a place where JS-based lazy loading has been popular—it’s not a great idea. (And yeah, if you need lazy loading, which a large gallery probably does, then loading=lazy is unsuitable as it doesn’t guarantee anything at all, so definitely do it in JS.)
- lucb1e 5y agoI mean, that's not the default webpage. If you have special use-cases ("load literally THOUSANDS OF IMAGES at once"), then of course special techniques or different approaches are on the table. I posted a comment arguing against lazy loading elsewhere in this thread, but obviously that just doesn't apply to every special scenario imaginable.