Lazy Chargement

How lazy chargement images and iframes improves Core Web Vitals, the chargement attribute, the SEO risks of lazy-loading above-the-fold content, and how Googlebot renders deferred content.

Première publication : 2 juil. 2026 · Dernière mise à jour : 3 août 2026 · Advanced
Langues

Lazy chargement defers off-screen images and iframes jusqu’à they're à propos de to scroll into view, cutting initial page weight and helping Core Web Vitals. The native façon is the chargement="lazy" attribute on <img> and <iframe> — aucun JavaScript nécessaire. The big mistake is lazy-loading votre hero/LCP image, qui delays Plus grand affichage de contenu. Googlebot doesn't scroll or click, so anything gated behind a scroll or click event peut go unseen. It's pas a direct ranking factor — the effect runs via Core Web Vitals and crawlability. Vérifier ce que en réalité renders in Search Console's Inspection d’URL Outil: the image URLs devrait sit in the src attribute of the rendered HTML.

TL;DR — Lazy chargement defers off-screen images and iframes jusqu’à ils near the viewport, cutting initial page weight (helps LCP) and startup main-thread fonctionner (helps INP). The native loading="lazy" attribute on <img>/<iframe> has replaced la plupart JS libraries; seulement lazy and eager are meaningful valeurs (auto is deprecated). The damaging mistakes: lazy-loading the LCP/above-the-fold image (delays the very metric you’re chasing), and gating content behind scroll/click — qui Googlebot jamais triggers parce que it doesn’t interact with lune page. It’s pas a direct ranking factor; the effect runs via Core Web Vitals and crawlability. Vérifier in Search Console’s Inspection d’URL Outil que image URLs land in the src attribute of the rendered HTML.

Ce que lazy chargement en réalité fait

The idea is simple: seulement charger resources quand vous besoin les, au lieu de chargement everything at une fois. On a media-heavy page, downloading every image and embed up front garde le navigateur busy fetching choses the visitor may jamais scroll to — burning bandwidth, memory, and battery pour nothing. Deferring the off-screen ones lets the above-the-fold content paint sooner. Martin Splitt made exactly ce point on Google’s Search Off the Record episode “Lazy loading demystified”: the goal is to éviter fonctionner que yields nothing, parce que non-critical images lune page voudrait be fine sans simplement garder le navigateur occupied.

Ce connects to the Core Web Vitals la plupart personnes are chasing. Fewer bytes competing pour the network up front signifie the Plus grand affichage de contenu element peut render sooner. Pour iframes — ads, social widgets, comment sections, maps — deferring les aussi cuts main-thread fonctionner during startup, qui is an Interaction jusqu’au prochain affichage win, pas simplement an LCP un. Google’s propre web.dev guidance frames lazy-loaded iframes as an INP improvement during page charger.

Native vs. JavaScript-driven lazy chargement

A few années ago, navigateurs gained a native loading attribute pour images and iframes, so vous pouvez hand the whole job to le navigateur au lieu de wiring up a JavaScript API. In my JavaScript SEO guide at Ahrefs I faire the même observation: since I premier wrote que piece, lazy chargement has mostly déplacé from being JavaScript-driven to being handled by navigateurs. You’ll encore run into JS-driven setups, and pour images they’re usually fine — the chose I vérifier is si réel content (pas simplement images) is being lazy chargé, parce que ceux setups are the ones que have caused content pas to be picked up correctement.

The native version:

<!-- Below-the-fold image: defer it -->
<img src="gallery-07.jpg" loading="lazy" width="800" height="600" alt="…">

<!-- Off-screen embed: defer it -->
<iframe src="https://www.youtube.com/embed/…" loading="lazy" title="…"></iframe>

Toujours définir explicit width/height (or an aspect-ratio) on lazy images so le navigateur reserves the space avant the image loads — that’s the biggest layout-shift risk with deferred images. Reserved dimensions aren’t an absolute CLS guarantee, though: si the surrounding layout or a responsive crop encore changements après the image loads, vous pouvez encore voir a shift, so confirmer with a réel layout-shift trace plutôt que assuming fixed dimensions alone settle it.

Lazy chargement and iframes besoin un plus distinction: loading="lazy" on an <iframe> seulement defers quand the embed’s récupérer and creation se produire. It doesn’t définir its title, focus behavior, sandbox, allow/permissions policy, referrerpolicy, consent handling, or dimensions pour vous — ceux encore besoin leur propre attention, and an embed peut garder doing fonctionner (scripts, tracking pixels, layout) une fois it becomes eligible to charger. And don’t assume “below the fold” behaves the même everywhere: display: none content, offscreen carousel slides, transformed elements, and nested scroll containers peut intersect the viewport differently que a plain below-the-fold element, so tester the réel layout and navigation contrôle plutôt que assuming equivalence.

The loading attribute’s valeurs

Seulement two valeurs matter today:

  • loading="lazy" — defer the resource jusqu’à it’s near the viewport.
  • loading="eager" — charger it immédiatement, the par défaut behavior. Utiliser it to be explicit à propos de above-the-fold images.
Evidence for this claim The native loading attribute supports lazy loading for images and iframes without a JavaScript lazy-loading library. Scope: Browser-level lazy loading behavior; browser heuristics decide the fetch distance. Confidence: high · Verified: web.dev: Browser-level image lazy loading

Vous may voir loading="auto" in older articles — it’s deprecated in Chrome, so don’t reach pour it. There’s aucun besoin to; omitting the attribute déjà donne vous the par défaut (eager) behavior.

How near is “near”? loading="lazy" is a hint, pas an author-controlled guarantee — the spec leaves the réel near-viewport decision to le navigateur. Chromium tries to récupérer a lazy resource early suffisant que it’s ready by the temps vous scroll to it, and the trigger distance varies by navigateur, connection speed, and resource type; it isn’t a fixed pixel valeur vous pouvez rely on or reproduce à travers navigateurs or versions. Don’t publish — or trust — a spécifique “loads N pixels before the viewport” number; treat the near-viewport window as implementation-defined and confirmer réel behavior with a Network trace on le navigateur/connection vous care à propos de au lieu de assuming a constant.

Native lazy chargement aussi plays fine with responsive images: it s’applique to ordinary src and srcset/sizes selection, so vous don’t lose responsive image behavior by ajout loading="lazy". Si vous à la place hide the réel URL seulement in a data-* attribute pour a script to swap in plus tard, chargement now dépend on que script — tester the rendered HTML and ce que se produit si the script fails (plus on ce in the Scripts and Troubleshooting tabs).

Evidence for this claim Native lazy loading works with ordinary src and responsive srcset/sizes selection; hiding the real URL only in data-* attributes makes loading dependent on script and should be tested in rendered HTML and under script failure. Scope: responsive image fetching and layout Confidence: high · Verified: HTML Standard: img

The #1 mistake: lazy-loading the LCP / above-the-fold image

Ce is the échec I voir la plupart, and every source agrees on it. Si vous lazy-load the hero image — or quelconque image probable to be the LCP element — you’ve told le navigateur to wait on the unique la plupart important pixel pour perceived charger speed. Le navigateur aussi can’t lazy-load an image jusqu’à it knows où the image va sit on lune page, so lazy above-the-fold images tend to charger plus slowly que eager ones. Que directement delays Plus grand affichage de contenu, the metric Google dit devrait resolve dans the premier 2,5 seconds of charger.

Do not lazy-load the observed or likely LCP image; confirm the actual request and paint timing in a trace. Source : Lazy Loading

The eager path discovers the likely LCP image in HTML and starts its request promptly. The lazy path waits for browser loading heuristics before request start. The comparison uses no fixed timing values and notes that actual LCP must be measured.

© Patrick Stox LLC · CC BY 4.0 ·

Splitt put the flip side plainly on the SOTR episode: si you’re pas en utilisant lazy chargement où vous devez, que va probably hurt some aspect of Core Web Vitals — la plupart probable LCP. So it cuts les deux façons. The rule:

  • Probable or observed LCP candidate → charger eagerly (omit loading="lazy", or définir eager). Considérer fetchpriority="high" on the LCP image.
  • Ci-dessous the fold → loading="lazy".

Pas every image ci-dessus the fold is the LCP candidate — identifier the réel un (a Performances trace or PageSpeed Insights va nom it) and vérifier its requête timing plutôt que treating every first-screen image the même. And ces are separate hints, pas un setting: loading="eager" (or omitting loading) seulement signifie le navigateur won’t defer discovery of the resource — it doesn’t itself raise récupérer priority. fetchpriority is a distinct, advisory hint on top of que. Stacking a <link rel="preload"> with chargement="lazy" on the même resource sends le navigateur conflicting intent, so vérifier the réel network waterfall plutôt que assuming the combination fait ce que vous expect.

The blanket anti-pattern is switching on lazy chargement pour every image site-wide — a courant CMS par défaut. As Splitt noted, si every image is lazy chargé, alors images que are (or devrait be) immédiatement visible obtenir lazy chargé aussi, qui is exactly the cas vous vouloir to éviter.

How Googlebot renders lazy-loaded content

Here’s the exploration reality que trips personnes up: Googlebot doesn’t scroll, and it doesn’t click. It renders votre page with a headless navigateur, but it doesn’t simulate a utilisateur interacting with it. Google states ce directement — its recommended lazy-loading méthodes deliberately don’t rely on utilisateur actions comme scrolling or clicking, parce que Recherche Google ne fait pas interact with votre page.

Evidence for this claim Google Search does not scroll or click to trigger lazy-loaded content, so implementations should not depend on user interaction and should expose resource URLs in rendered HTML. Scope: Google Search guidance for JavaScript-driven lazy loading. Confidence: high · Verified: Google Search Central: Lazy-load content

That’s pourquoi the how of votre implementation matters. Google’s doc listes three implementations it considers safe: le navigateur’s built-in lazy chargement pour images and iframes, the IntersectionObserver API (with a polyfill), or a JavaScript library que loads données as it enters the viewport. Tout three clé off viewport intersection — pas a scroll or click event que Googlebot va jamais fire.

The high-risk pattern is a custom or third-party JS lazy-load library. Si the library misbehaves and the image URL jamais lands in the src attribute, Google simply won’t pick que image up — Splitt décrit exactly ce échec mode on the SOTR episode. There’s nothing to index si l’URL isn’t là. Ce is the même chose I flag in my JavaScript SEO guide: image lazy chargement is usually fine, but lazy-loaded content is où indexation problems creep in, and the fix is to vérifier ce que Google en réalité renders.

Infinite scroll is a différent problem

Don’t conflate basic image/iframe lazy chargement with infinite scroll or paginated chargement. Deferring images is un chose; chargement nouveau chunks of content as the utilisateur scrolls is un autre, and it nécessite its propre architecture. Google’s guidance: give chaque chunk a persistent, unique URL, garder le contenu stable per URL (utiliser absolute page numbers comme ?page=12, pas relative valeurs comme ?date=yesterday), and mettre à jour the affiché URL with the History API as chaque chunk becomes the principal visible content so it peut be refreshed, shared, and lié. Skip que and the deeper content behind an endless scroll may jamais be reliably crawled or indexé.

Comment tester it

The verification chemin is the même in Google’s doc and in my propre methodology: utiliser Search Console’s Inspection d’URL Outil and regarder at the rendered HTML. Si votre image (or video) URLs apparaître in the src attribute on the <img>/<video> elements in que rendered HTML, votre setup fonctionne. Google dit ce outright — vérifier the rendered HTML to assurez-vous votre content is in it. Si l’URL is manquant from src, that’s votre problem, and it usually points back to a scroll/click trigger or a broken library.

Pour a lazy-loaded product grid, go au-delà ce presence vérifier. Run the Infinite Scroll SEO testing matrix with standard and tall viewports, fresh navigation and post-load resizing, no-action and incremental-scroll runs, unique product-link counts, and accessibility-tree inspection. Resizing an initialized page n’est pas equivalent to navigating at the final viewport size parce que observers and batch calculations may be registered seulement during startup. Evidence for this claim Google Search does not scroll or click to trigger lazy-loaded content, so implementations should not depend on user interaction and should expose resource URLs in rendered HTML. Scope: Google Search guidance for JavaScript-driven lazy loading. Confidence: high · Verified: Google Search Central: Lazy-load content

Vous pouvez aussi lean on votre web-performance tooling: PageSpeed Insights flags off-screen images vous devez be deferring. In my PageSpeed Insights guide at Ahrefs I remarque que the “defer offscreen elements” audit is telling vous to lazy-load images — a handy façon to connecter the diagnostic vous déjà run to the fix.

Ranking-signal honesty

Be clair à propos de ce que lazy chargement is and isn’t. En utilisant it is pas a direct ranking factor, and pas en utilisant it isn’t a penalty. The connection to rankings is indirect: it flows via Core Web Vitals (mainly LCP, parfois INP pour iframes) and via crawlability, si a bad implementation hides content. Splitt characterized the ranking effect via Core Web Vitals as a tiny, minute factor in la plupart cas. So optimize lazy chargement pour votre utilisateurs’ charger experience and pour clean indexation — pas parce que vous expect a ranking bump from the attribute itself.

Où ce fits

Lazy chargement is un lever in the broader web performances toolkit. It pairs with resource hints (preload/preconnect pour the resources vous do vouloir early), font-loading strategy, mise en cache, and a CDN — and it’s judged, ultimately, via Core Web Vitals. Obtenir the above-the-fold/below-the-fold split correct and it’s un of the cheapest wins disponible.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.