Chat with StauUsually replies in seconds

Before we start, leave your email. If the chat drops, our reply reaches you there.

Stau

Lazy Loading: A Simple Technique to Improve Performance

Discover how lazy loading can speed up your website by loading images and videos only when needed. A practical implementation guide.

Imagine walking into a restaurant and the waiter brings out every dish on the menu at once, even though you only plan to eat one. Absurd, right? That is exactly what happens when a website loads all its images and videos at once, even those the visitor will never see. Lazy loading solves this problem elegantly and can speed up your page load time by up to 50%.

What is Lazy Loading

Lazy loading is a technique that defers the loading of non-essential resources until they are actually needed. In practice, this means images, videos, and iframes that are below the visible area of the screen are only loaded when the user scrolls to them.

The result is a much faster initial load, since the browser does not need to download dozens of images the visitor is not seeing yet. Only the visible content is loaded immediately.

The Real Impact on Performance

The benefits of lazy loading are significant and measurable:

  • 30-50% reduction in initial load time: fewer resources to download means a page ready faster.
  • Bandwidth savings: visitors who do not scroll to the bottom of the page do not download images they would never see.
  • Improved LCP: with fewer resources competing for bandwidth, the largest visible element loads faster.
  • Lower memory usage: the browser does not need to store all images simultaneously.

How to Implement Lazy Loading

Modern lazy loading implementation is surprisingly simple:

Native HTML Method

HTML5 introduced the loading="lazy" attribute, which can be added directly to image and iframe tags. It is the simplest and most efficient way to implement lazy loading, with no additional JavaScript needed.

Simply add the attribute to images that are below the fold. Images that appear in the initial visible area of the page should not use lazy loading, as this can delay the display of the most important content.

Lazy Loading with JavaScript

For more advanced scenarios, JavaScript libraries like Lozad.js and Lazysizes offer additional features such as placeholders, fade-in effects, and preloading based on scroll proximity.

Lazy Loading on Popular Platforms

  • WordPress: since version 5.5, WordPress applies lazy loading automatically to all images. Plugins like WP Rocket offer more granular control.
  • Shopify: most modern themes already include lazy loading. Check your theme settings.
  • Wix and Squarespace: implement lazy loading automatically on their platforms.

Important Considerations

While lazy loading is a powerful technique, some care is needed:

  • Do not apply to above-the-fold images: content visible immediately should load normally to avoid hurting LCP.
  • Set dimensions on images: without defined width and height, the page may "jump" when images load, increasing CLS.
  • Use placeholders: a reserved space (solid color or low-resolution version) prevents the page from looking broken while the image loads.
  • Test at different speeds: simulate slow connections to ensure the experience is good even on 3G.

Conclusion

Lazy loading is one of the performance optimization techniques with the best cost-benefit ratio. It is simple to implement, requires no financial investment, and can cut load time in half. If your site has pages with many images or videos, implementing lazy loading should be a priority in your speed optimization strategy.

Written by

The Stau team · Stau

We build websites that build themselves, for American small businesses that would rather run the business.

Keep reading

Your site can have all of this
built in, by tonight.

The builder writes, designs, and structures your site with everything these articles teach. Watching it happen is free.

Full preview · No account · No credit card