Better image loading: decoding="async" height="x" loading="lazy" #8106
Replies: 1 comment
-
Good ideas!
This appears to be different from browser to browser. As such, I would prefer to defer to the user's implicit choice here.
By itself, I think this is risky. Not loading the image ahead of scrolling might interact badly with our scroll computations (which we use to hide/show sidebars as needed). It might be a safe thing to do if we also enable the
Two issues here. First, we can't always determine this image size, and to do it portably would require help from Pandoc. (by eg. enhancing the mediabag API) Second, I'd like to be sure that a setting like this cannot interfere with our current CSS; it seems safer than |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Currently, in the HTML generated,
<img>
tags are simple likeHowever, I think it would be better to allow async lazy loading like
This accomplishes several things: The
decoding="async"
allows text to load without blocking. Theloading="lazy"
allows images to only load when the user scrolls there. Theheight="649"
means there is no Cumulative Layout Shift (CLS) as the page loads.Beta Was this translation helpful? Give feedback.
All reactions