Skip to main content

What is lazy loading?

Lazy loading, also known as delayed loading, is an optimization technique for online content, especially forimagesandvideos on websites. The main goal of lazy loading is to improve the loading time of a website by only loading resources that are outside the current browser window when they become visible to the user as they scroll down the page. This means that instead of loading all elements of a website at once, only those objects that are currently visible to the user are loaded.

This reduces the amount of data loaded simultaneously, which shortens loading times and reduces bandwidth usage.

How do I enable lazy loading in HTML?

To manually enable lazy loading in HTML, you can use the loadingattribute in your <img> and <iframe> Use tags. Here is a simple example of how lazy loading is implemented for an image:

<img src="/bild-url.jpg" loading="lazy" alt="Beschreibung des Bildes">

In this example, the loading="lazy" Attribute added to enable delayed loading of the image. This can be applied similarly to videos and iframes:

<iframe src="/video-url" loading="lazy" width="560" height="315"></iframe>

By using the loading="lazy" attribute, the developer tells the browser that the element should be loaded with a delay. It should be noted that this technique is supported by most modern browsers.

Why is lazy loading important for SEO?

Lazy loading is important forsearch engine optimization(SEO) for several reasons. One of the most important advantages is the improvement in page loading speed. Since search engines such as Google use page speed as one of their ranking factors, lazy loading can directly contribute to improving your website's position in search results.

A faster website also provides a better user experience, which is another critical factor for SEO. Delaying the loading of content that is outside the visible area allows server resources to be used more efficiently and improves the overall performance of the page. Lazy loading also reduces thebounce rate, as users are less likely to leave a slow-loading page early.