HTML-only conditional lazy loading (via preload and media)
1–10 of 23 posts
Re: HTML-only conditional lazy loading (via preload and media)
#2Re: HTML-only conditional lazy loading (via preload and media)
#3I didn't know that. Apparently (at least according to Claude) you shouldn't use loading="lazy" on images that you expect to always display because doing so causes them to not be loaded until the browser has determined they are definitely in the viewport, which is a minor performance regression.
LCP = Largest Contentful Paint, the Core Web Vitals metric for when the largest visual element finishes rendering. That's usually the largest above-the-fold image.
Re: HTML-only conditional lazy loading (via preload and media)
#4> The accepted practice is to not add lazy-loading to images above the fold, especially the LCP image. I didn't know that. Apparently (at least according to Claude) you shouldn't use loading="lazy" on images that you expect to always display because doing so causes them to not be loaded until the browser has determined they are definitely in the viewport, which is a minor performance regression. LCP = Largest Content…
Re: HTML-only conditional lazy loading (via preload and media)
#5Which part of it is not documented? Putting device width dependent preloading in HTTP header? MDN says that the HTTP link header works the same way as the link element, and also that the link element a has media attribute : https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
Re: HTML-only conditional lazy loading (via preload and media)
#6> Not documented anywhere (but seems to work fine in major browsers) Which part of it is not documented? Putting device width dependent preloading in HTTP header? MDN says that the HTTP link header works the same way as the link element, and also that the link element a has media attribute : https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
Re: HTML-only conditional lazy loading (via preload and media)
#7Re: HTML-only conditional lazy loading (via preload and media)
#8Re: HTML-only conditional lazy loading (via preload and media)
#9Is it the “min-width=1024px” in the link that causes it to not load on smaller devices?
Re: HTML-only conditional lazy loading (via preload and media)
#10Is it the “min-width=1024px” in the link that causes it to not load on smaller devices?