3 ms·
I have to disagree with his final suggestion, lazy loading images for a faster load. In my opinion, unless your page is extremely image heavy, lazy loading imag
by mdoms 6y ago
I have to disagree with his final suggestion, lazy loading images for a faster load. In my opinion, unless your page is extremely image heavy, lazy loading images causes more problems than it solves. It's a janky and annoying user experience every time I scroll a Medium post and have to wait a few seconds waiting for a big blurry square to pop into an image. I would much rather that stuff was loading eagerly and ready for me when I scroll.
Not to mention, knowing about their ecosystem, I shudder to think of the size of some of these JS libraries performing the lazy loading.
- thesuitonym 6y agoI've got to agree. Lazy loading is obnoxious and unnecessary. Browsers already load images from top to bottom, so unless your site is already extremely slow, you gain nothing from it. It also makes sites feel slower, since instead of reading a paragraph, and scrolling down to see an image, you read a paragraph, scroll down, and find an image loading.
- untog 6y ago> Browsers already load images from top to bottom Is that true? I believe that they kick off the requests to load images from top to bottom, but I don't think they prioritise bandwidth in such a way that downloading image #3 will never make downloading image #1 slower.
- hagy 6y agoThat is my understanding as well and I checked mozilla documentation to confirm. [0] That link also covers loading="lazy" attribute for <img> tags, which I've commonly used to defer loading. [0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading https://developer.mozilla.org/en-US/docs/Web/HTML/Element/im...
- mercer 6y agoI find that the optimal solution is to load all images 'above the fold' (perhaps optimizing for a 'tall' screen) and lazy-load the rest, when they get close to being on-screen. if possible I also try to make sure loading these images doesn't change the flow of the page, but in most cases images have to fit/cover fixed dimensions anyways.