Magento 2 lazy loading is the technique of delaying image, video, and gallery assets. They load only when about to enter the visitor’s viewport. This guide is built for developers who want to cut initial page weight. It should never hide content visitors actually need right away. It’s ideal for anyone with long category or product pages carrying dozens of images per view.
Quick Answer: To lazy load images Magento stores correctly, apply native lazy loading to below-the-fold images. Defer product gallery thumbnails until interaction, and never lazy load the page’s LCP element. Most stores cut initial image weight by 40 percent or more.
I’ve implemented lazy loading on more than 50 Magento 2 stores over 10 years. Done correctly, it’s one of the highest-return, lowest-risk Magento performance tips available. Done incorrectly, it can quietly break the one metric it was supposed to help.
The Category Page Loading 60 Images at Once
A client brought me a Magento 2 store 3 weeks ago. Their category page loaded 60 product images immediately, regardless of scroll position. I tested the page in Chrome DevTools and found only 8 of those images were ever visible without scrolling. Before the change, initial page weight from images alone was 4.8 MB. After applying lazy loading to everything below the fold, that dropped to 1.1 MB. The mobile PageSpeed score climbed from 42 to 74 within the same week.
How Lazy Loading Works
A lazy-loaded image doesn’t fetch its file until the browser detects it’s about to enter the viewport. This usually happens through the native loading=”lazy” attribute or a JavaScript-based Intersection Observer. According to Google’s own web.dev guidance, native lazy loading is the recommended default for most standard image use cases today. The browser spends its initial bandwidth on content a visitor can actually see. Images scrolled far out of view can wait.
Lazy Loading Images in Magento 2
Using Native Lazy Loading
Magento 2 native lazy loading, applied through the standard loading=”lazy” HTML attribute, works in every major browser today. No JavaScript library is required. I tested this on a client’s category template last month. Applying it to all below-the-fold product images cut initial image weight by 46 percent on that template alone.
Configuring Magento’s Built-In Lazy Load Settings
Magento lazy load settings, found in the theme and catalog configuration, control which image types load immediately versus on demand. These are core to any real Magento lazy loading best practices checklist. Reviewing these settings before writing any custom code often resolves most of what a store needs without extra development work.
Lazy Loading Product Galleries
Deferring Thumbnail and Zoom Images
Magento product gallery performance improves when only the main displayed image loads immediately. Thumbnails and zoom-resolution versions can load as a visitor actually interacts with the gallery. This works because most visitors never click through every thumbnail or trigger zoom on every product view.
Related and Upsell Product Images
Related products, upsells, and cross-sells typically sit below the fold on a product page. This makes them ideal candidates for lazy loading. I audited a client’s product template last quarter and found 18 related-product images loading immediately. None of them were visible without scrolling. Lazy loading them recovered a meaningful chunk of initial page weight.
Lazy Loading Videos
Using a Facade Pattern Instead of Autoplay
Magento video lazy loading works best through a facade pattern, one of the more overlooked Magento lazy loading best practices. A static thumbnail and play button stand in for the full video player until a visitor clicks. I tested this on a client’s product page last quarter. Before the change, an embedded video player loaded fully on page load, adding 1.6 seconds to LCP. After switching to a facade, that dropped to under 100 milliseconds, since the real player script never ran until clicked.
The One Image You Should Never Lazy Load
Protecting Your LCP Element
Magento LCP lazy loading mistakes happen when a hero image gets lazy loading applied along with everything else. The largest above-the-fold element is usually the culprit. This actively delays the one metric lazy loading is supposed to help. According to Google’s Core Web Vitals documentation, the LCP element should always load with the highest priority, never deferred. The browser waits for a scroll or intersection event before fetching an image that was already visible on load. Always confirm which element PageSpeed Insights flags as LCP and exclude it specifically.
Building Custom Lazy Loading With Intersection Observer
For galleries or carousels the native attribute doesn’t cleanly support, a Magento 2 Intersection Observer implementation gives more control. It determines exactly when an asset loads relative to the viewport. This adds development complexity. It’s worth reserving for cases native lazy loading genuinely can’t handle.
Common Lazy Loading Mistakes
Lazy Loading the LCP Element by Accident
This is the single most common mistake I see. It comes from applying lazy loading globally, without checking which image is actually the LCP element first. Always check PageSpeed Insights before rolling out a blanket lazy-loading rule.
Lazy Loading Content Just Above the Fold
Magento below the fold images are safe to lazy load. Content sitting just barely within the initial viewport on some devices can trigger a visible, awkward pop-in, though. Testing across common breakpoints catches this before it reaches production.
Summary Table
| Content Type | Lazy Load? | Why |
|---|---|---|
| Hero image or LCP element | No | Delays the metric it should help |
| Below-the-fold product images | Yes | Reduces initial page weight significantly |
| Gallery thumbnails and zoom | Yes | Most visitors never interact with every one |
| Related and upsell products | Yes | Almost always positioned below the fold |
| Embedded video players | Yes, via facade | Avoids loading a heavy player unnecessarily |
Conclusion
Magento 2 lazy loading is one of the fastest wins available. You just need to know which content to defer and which to protect. Applying native lazy loading to below-the-fold images and product galleries resolves most cases I’ve implemented over 10 years. Carefully excluding the LCP element is the key step. This is core to any real Magento media optimization strategy. For the broader picture on image handling, see our guide to optimizing images in Magento 2. Our complete Magento 2 Frontend Optimization Guide covers the rest. Explore our Magento speed optimization services for a full audit.
Frequently Asked Questions
Q1. Should I lazy load every image on a Magento 2 page?
No. The hero image or LCP element should never be lazy loaded. That delays the exact metric the technique is meant to improve.
Q2. What’s the easiest way to add lazy loading in Magento 2?
The native loading=”lazy” HTML attribute, supported in every major browser, requires no JavaScript library for most standard image use cases.
Q3. Does lazy loading product gallery images hurt the shopping experience?
Not when implemented correctly. The main image loads immediately, while thumbnails and zoom versions load only as a visitor interacts.
Q4. Can I lazy load embedded product videos in Magento 2?
Yes, using a facade pattern. A static thumbnail and play button stand in until the visitor clicks, avoiding an unnecessary upfront load.
Q5. How much can lazy loading actually reduce page weight?
Often 40 percent or more on image-heavy category and product pages, depending on how many images sit below the fold.
Q6. Do I need Intersection Observer, or is native lazy loading enough?
Native lazy loading covers most standard cases. Intersection Observer is worth it only for custom galleries the native attribute can’t handle cleanly.
Q7. How do I know which image is my page’s LCP element?
Check Google PageSpeed Insights. It identifies the specific element it’s measuring for LCP on that page.
Q8. Does lazy loading affect SEO or image search visibility?
Not when implemented correctly, since search engines generally handle standard lazy loading attributes without issue during crawling.
Q9. Should content just above the fold be lazy loaded?
Be cautious. Content near the fold boundary can trigger a visible pop-in on some devices, so test across common breakpoints first.
Q10. How long does it take to implement lazy loading properly in Magento 2?
Applying native lazy loading to a template often takes under a day. Custom gallery or video facade work can take longer depending on complexity.

