Hacker News new | ask | show | jobs
by stereobooster 2946 days ago
Can you explain why?
2 comments

Lazy loading clearly works because there are sites that manage it well. But when I hear "lazy loading" I think "Medium".

The typical experience reading a medium blog is that I can spend a minute, or a full 15 minutes, digesting the opening paragraphs. With the page idle that whole time. Then I can scroll down to a big brown smear, and read the whole caption before the associated image finishes loading.

I totally understand these images don't need to load with the first round of content. But you know I'm going to scroll down. Just use a timer or something.

You have to wait for react to load and initialize on the client before an image can load.
images and everything else bc client-side rendering... not sure how this is an argument for not lazy-loading images though
Because images won’t even start loading until JavaScript fully downloads and executes versus loading in parallel with other activities in the page.
As an end user it feels slow. If I hold my space bar on a website created in 1995, I can scan the entire page contents.
What you are talking about is more like graceful degradation. If server side rendering is used you will be able to see content ASAP, but not able to scroll, because interaction is blocked by JS. But if you will visit page with JS disabled you will get what you want, because component generates img in noscript tag and you will be able press space to scan the page
Actually pages that use a component like the one in this submission typically show a blurry "beer goggle" version of the image, waiting for JS to replace them with a hi-res version. So with no JS you get a page of beer goggle images (BBC does this for instance).
But not this component. This component will load images without JS. Test it yourself https://stereobooster.github.io/react-ideal-image-experiment...
You'd still have blank spaces where large images are as they're loading on a slow connection
I'm talking about lazy loading that waits until the image enters the viewport. An HTML page created in 1995 loads the images eagerly.