Closed weotch closed 3 years ago
In the tests I ran, I didn't notice an improvement in PageSpeed scores. I tested this on a page of a production website and the scores were worse. I think the issue is that the native implementation is less conservative and eager loads images from further down the page (note 11 images loaded rather than 4).
I'm not going to merge this because I'm not seeing a benefit and it adds to the code complexity.
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading.
My hope is that this will improve PageSpeed scores because we don't need to create
IntersectionObserver
instances in order to do lazy loading.