Lazy Loading

SEO, AEO & GEO Glossary

Lazy loading defers loading images, iframes and other resources until they are about to enter the viewport, speeding up initial page load and saving data.

What is Lazy Loading?

Lazy loading is a web performance technique that defers loading non-critical resources, such as images, iframes and videos below the fold, until they are about to enter the user’s viewport. The page renders its visible content faster, uses less bandwidth, and only fetches the rest if the user scrolls far enough to need it.

Modern browsers support lazy loading natively through the loading="lazy" attribute on <img> and <iframe> elements, so most sites no longer need a JavaScript library. For content-heavy B2B SaaS pages with screenshots, diagrams and embedded videos, it can significantly reduce initial page weight.

How it works

  1. The browser parses the HTML and finds images marked loading="lazy".
  2. It skips fetching those that are far from the viewport.
  3. As the user scrolls, the browser requests each image shortly before it becomes visible.
  4. Images above the fold, or marked loading="eager" (the default), load immediately.

A minimal example:

<img src="architecture-diagram.png" alt="Zero trust architecture diagram" width="800" height="450" loading="lazy">

Always include width and height so the browser reserves space and avoids layout shift.

Examples

  • A cybersecurity vendor’s product page has 15 screenshots. Lazy loading those below the fold means the browser downloads only the first few on load.
  • A documentation site embeds YouTube videos via iframes with loading="lazy", avoiding heavy third-party scripts until a reader reaches them.
  • A team lazy loads every image including the hero banner and sees LCP get worse. Removing lazy loading from the hero fixes it.

Best practices

  • Use native loading="lazy" for offscreen images and iframes.
  • Load the LCP image eagerly, and consider fetchpriority="high" for it.
  • Set explicit dimensions to prevent Cumulative Layout Shift (CLS).
  • If using JavaScript lazy loading, trigger loads with IntersectionObserver, not scroll events or clicks.
  • Keep image src or srcset in the HTML so crawlers can discover image URLs.
  • Check rendered HTML with Search Console’s URL Inspection tool.

Common mistakes

  • Lazy loading above-the-fold content, which harms LCP.
  • Hiding primary text content behind “load more” interactions that Googlebot will not trigger.
  • Missing width and height attributes, causing layout shifts.
  • Using placeholder images without the real URL in markup, so image search cannot index them.

AI crawlers vary in how much JavaScript they execute, and many fetch only the raw HTML. Text that appears only after JavaScript-driven lazy loading may be invisible to them. Keep important text in the initial HTML and reserve lazy loading for media, so both search and AI crawlers see the content that should be cited.

Sources

Frequently asked questions

Is lazy loading good for SEO?

Yes, when implemented correctly. It reduces initial page weight and can improve Core Web Vitals. Google can index lazy-loaded content as long as it loads when it enters the viewport, without needing user actions like clicks or scrolling events that Googlebot does not perform. Native loading="lazy" is the safest method.

Should I lazy load the hero image?

No. The hero or largest above-the-fold image is often the Largest Contentful Paint element. Lazy loading it makes the browser wait before requesting it, which delays LCP. Load it eagerly, and consider fetchpriority="high" for the LCP image. Lazy load only images further down the page.

Can Google see content that is lazy loaded with JavaScript?

It can if the content loads when it becomes visible in the viewport, for example using the IntersectionObserver API. Content that loads only after a click, a swipe or a scroll event listener may not be seen. Use the URL Inspection tool to check the rendered HTML.

Technical SEOPage SpeedCore Web Vitals

Do not let AI keep
recommending someone else

Start your 7-day free trial and get your AI Visibility Score in about a minute. See exactly where you stand, where competitors are beating you, and the ranked fixes to get into the answer. Cancel anytime before the trial ends.

7-day free trial. Cancel anytime before it ends. Trusted by 500+ B2B SaaS teams.

Partnered with
Powered by