TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Native image lazy-loading for the web

115 pointsby skellertorabout 6 years ago

11 comments

radarsat1about 6 years ago
Ah right, lazy loading, this is the reason that I have to make sure to scroll down the entire length of a medium.com article I&#x27;m reading on my phone and back to the top again to make sure the diagrams and math-as-images load completely before I get on a subway line that doesn&#x27;t have 3g service. Hate it when I forget. Otherwise I&#x27;m left staring at blurry lines that don&#x27;t explain much about what trying to read until it&#x27;s time to get off. Sucks when my commute is 40 minutes straight on the same line.<p>I guess an advantage of a &#x27;native&#x27; feature could be that browsers could offer a button saying &#x27;please pre-load this page!&#x27;
评论 #19597555 未加载
评论 #19599116 未加载
评论 #19599592 未加载
评论 #19597855 未加载
评论 #19598162 未加载
评论 #19598657 未加载
评论 #19599383 未加载
评论 #19598415 未加载
评论 #19598843 未加载
评论 #19598324 未加载
oftenwrongabout 6 years ago
Why would I want the loading behaviour of images to be chosen by the site I am browsing?<p>I would prefer to choose for myself whether images load eagerly or lazily on all sites I visit. This way, I would always know which type of loading to expect as I browse, and I would always get the type of loading I prefer.
评论 #19597615 未加载
评论 #19597629 未加载
评论 #19604714 未加载
lol768about 6 years ago
This attribute appears to have been proposed and implemented by Google. Has any other vendor expressed an intent to implement&#x2F;actually implemented this yet?<p>It seems a little premature to describe this as native support &quot;for the web&quot; if the functionality is limited to one vendor and you&#x27;re forced to use a polyfill everywhere else.
评论 #19600280 未加载
gardaaniabout 6 years ago
I hope that they ship this with image intrinsicsize &#x2F; aspect-ratio or whatever it is called now. Otherwise this lazy-loading will make page jumping and layout instability worse, because images are loaded only after the user has scrolled to their position.<p><a href="https:&#x2F;&#x2F;googlechrome.github.io&#x2F;samples&#x2F;intrinsic-size&#x2F;" rel="nofollow">https:&#x2F;&#x2F;googlechrome.github.io&#x2F;samples&#x2F;intrinsic-size&#x2F;</a>
评论 #19600705 未加载
评论 #19599016 未加载
revskillabout 6 years ago
That&#x27;s why i love React Suspense very much. It offers the flexibility in the hand of developers instead of some inflexible native API.<p>&lt;Suspense fallback={&lt;Placeholder &#x2F;&gt;}&gt; &lt;Image src=&quot;&quot; &#x2F;&gt; &lt;&#x2F;Suspense&gt;<p>When SSR, this one will show a real &lt;img&gt; tag. When SPA, this one will lazy load image.<p>A Win-Win for both devs and customers.
georgecalmabout 6 years ago
I’m excited about this. There’s usually a ton unnecessary CPU usage with the current techniques, not to mention the human time waste of re-implementing them in JS. There’s feature detection for this too, so we can gracefully degrade “loading” to existing solutions and take advantage of it right away.
leshowabout 6 years ago
Is this something just chrome is implementing or is this actually part of the HTML standard now?
评论 #19599451 未加载
really3452about 6 years ago
I hope they add an optional setting.<p>IE: &lt;img src=&quot;celebration.jpg&quot; loading=&quot;optional&quot; alt=&quot;...&quot; &#x2F;&gt;<p>Then there is a place-holder graphic in place that you could click on to load the image.
skilledabout 6 years ago
Hmm, I guess this is good news for WordPress users who won&#x27;t have to rely on a plugin to do this?<p>Excited to see what else they are going to bring to the browser to speed up sites.
评论 #19597293 未加载
s_y_n_t_a_xabout 6 years ago
Does this support aborting the network call if you scroll the element offscreen before it loads? That&#x27;s essential to infinite scrolling.
eschatonabout 6 years ago
Why would you have ever written JavaScript to lazy-load images?<p>The browser knows what’s on the page and can optimize its loading already. Don’t screw with that. This kind of assistance from the browser is why.<p>Also, you don’t need to run code in documents. Web pages are documents.