Don’t Be Lazy: 3 Problems with Lazy Loading and When to Use Eager Loading
Too Long; Didn't Read
Lazy loading is a technique used to delay the initialization of page elements. It is typically better performance and a reduction in cost, because pages are loaded faster. This article explains three critical lazy loading issues and explains when you should use eager loading. The majority of web browsers support lazy loading, but lazy loading is not a perfect solution. The solution is to use an API to detect images entering the viewport. Add a margin to images. You can define the margin by setting a bounding box via the rootMargin.