Magento 2 Experts — Hyvä Theme, Tailwind CSS & SEO from a Single Source ›

Magento 2 Lazy Loading for Images and iframes

Magento 2 Extension Hyvä Ready Magento 2.4.x

SKU: LAZYLOADINGIMAGES1

  • images and iframes load as you scroll
  • LCP image and first images stay excluded
  • placeholders and fixed dimensions against layout shifts
  • exceptions by CSS class, page or area
Auf Lager
€79.00

Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.

No download, but personal setup

No download, but personal setup. This product is not a downloadable software package for self-installation. With your order, you commission Mironsoft to individually set up this module in your shop. We will get in touch with you within 2 business days — we'll sort out the details and payment together then.

This offer is aimed at business owners and companies running a Magento 2 shop.

6 features

Magento 2 lazy loading: load fast without slowing the most important image

With Magento 2 lazy loading from Mironsoft, images and iframes of your shop load only once the visitor has almost reached them. That saves data and speeds up the first display. The most important image above the fold, the LCP image, stays excluded and is even loaded with priority. The module complements what Hyvä already does in the template with content from CMS, blog and third-party blocks.

Defer images

Images outside the visible area load only when the visitor is about to reach them.

iframes and videos

Embedded maps and videos load once they come into view and save requests.

LCP exception

The largest image on the first screen loads immediately and is delivered with high priority.

Placeholders

Until the image arrives, a placeholder in colour or as a frame holds the intended format.

Fixed dimensions

If width and height are missing on an image, the module adds them so the text does not jump.

Rules and exceptions

Define exceptions by CSS class, page type or layout handle.

Why lazy loading

Why Magento 2 lazy loading noticeably relieves the load time

Product lists, blog posts and CMS pages often contain dozens of images. If the browser loads all of them at once, they compete for the same bandwidth as the most important image and the page scripts. Visitors on mobile wait longer although they do not even see the lower images yet. That is why merchants look for Magento 2 lazy loading, for a way to defer Magento 2 images or for solutions to load time problems in Google PageSpeed.

The order matters. Anyone who defers everything across the board also delays the LCP image and worsens the very value that lazy loading is meant to improve. Magento 2 lazy loading with exception rules therefore separates clearly: what is visible immediately loads first and everything below follows later.

01Deferred loading

Magento 2 lazy loading for images: load only what becomes visible

The module adds the matching deferred-loading behaviour to images in the output HTML. In the normal case it sets the native browser attribute and adds a margin so that the image starts loading shortly before the viewport. This applies to content from CMS blocks, blog posts, page builder elements and product descriptions that a theme does not handle itself. Browsers without support show the image immediately; a noscript fallback makes sure it never goes missing.

  • Native browser feature, no extra script needed
  • Lead distance in pixels adjustable
  • Fallback for browsers without support
Configuration › Images
Defer images
yes
Lead distance
300 px (example value)
Affected areas
CMS, blog, description
Configuration › LCP protection
Skip first images
2 (example value)
High priority
first image
Exception class
no-lazy
02LCP exception

Exclude the LCP image from Magento 2 lazy loading

Largest Contentful Paint is usually a large image in the upper part of the page. It must never be deferred. The module therefore skips the first images of every page, a number you define, and can additionally give the most important image a high fetch priority. Where the LCP image is not the first one, mark it with a CSS class. An exception per page type, such as home page or product page, is possible as well.

  • First N images per page load immediately
  • High priority for the most important image
  • Exception by CSS class or page type
03iframes

Defer iframes and embedded content with Magento 2 lazy loading

Embedded maps, videos and forms often pull more data than the whole page layout. The module switches iframes to deferred loading and shows a placeholder with the desired aspect ratio until then. For videos from third-party portals a click on the placeholder can load the player first. That protects the load time and prevents connections to foreign servers from opening on page load. Whether consent is needed for that is for the shop owner to assess.

  • iframes load in the viewport
  • Placeholder in a fixed aspect ratio
  • Optionally only after a click on the placeholder
Configuration › iframes
Defer iframes
yes
Aspect ratio
16:9 (example)
Load only after click
videos
Configuration › Placeholders
Placeholder
colour #e2e8f0 (example)
Add dimensions
yes
Page types
all except checkout
04Placeholders

Magento 2 lazy loading placeholders and fixed dimensions against layout shifts

If text jumps because an image claims space afterwards, the layout stability score suffers. The module reads width and height from the image file, adds missing values and reserves the space. A neutral colour or a frame serves as the placeholder. If loading fails, the placeholder stays and the page does not shift. The rules apply per store view and can be limited to single page types.

  • Width and height are added if missing
  • Neutral colour or frame as placeholder
  • Configuration per store view and page type
Use cases

Where Magento 2 lazy loading helps in daily shop work

Typical pages with many images and embedded content.

Category pages with long lists

With Magento 2 lazy loading product images far down load only on scrolling. The first rows appear immediately and the page feels faster.

Blog and guides

Long articles with many images and embedded videos relieve the first page load without readers missing anything.

CMS pages with page builder

Banners, teasers and galleries from the page builder get deferred loading even if the theme does not treat them itself.

Pages with maps and videos

An embedded map in the footer loads only when the visitor scrolls there and does not block the start.

Comparison

Magento 2 lazy loading compared: without and with the module

The difference to loading everything at once or deferring everything across the board.

TopicWithout the moduleWith Mironsoft Lazy Loading Images
Images belowLoad at once and slow things downLoad when reached
LCP imageBlanket deferral delays itExcluded and prioritised
iframesLoad on page openLoad in viewport or after click
Layout shiftsImage pushes text downSpace reserved
ControlAll or nothingExceptions by class, page or count
Setup

How we set up Magento 2 lazy loading for you

The process after your order.

1

Measure

We record the current load time of the most important page types as a baseline.

2

Installation

We install Magento 2 lazy loading and set exceptions for LCP images.

3

Placeholders

We agree placeholder colour, aspect ratios and iframe behaviour with you.

4

Test

We check category, product, home page, blog and mobile view for missing images and shifts.

5

Handover

Your team gets the list of settings and knows where exceptions are added.

Scope

Scope: image optimisation and caching

Magento 2 lazy loading only controls when an image is loaded. It changes neither the format nor the size of the file and replaces no image compression, no WebP and no CDN. The page cache remains unchanged as well; the module works together with the Magento full page cache and creates no caching of its own.

The combination brings the most: small files, a fast cache and targeted deferral. The module runs without jQuery and without extra scripts in the Hyvä theme.

05How the purchase works

No download, but personal setup

Lazy Loading Images is not listed here as a finished download file for self-installation. The purchase is a commission: after the purchase we get in touch, install the module in your shop and agree exceptions, placeholders and iframe behaviour with you.

Important to know

Your purchase does not include a download link. We will get in touch with you within 2 business days — we'll sort out the details and payment together then. This offer is aimed at business owners and companies running a Magento 2 shop.

FAQ

Frequently asked questions

Everything important about deferral, LCP, iframes and how the purchase works.

How can I enable lazy loading for images in Magento 2?
With Magento 2 lazy loading you switch deferral on in the configuration. Images outside the viewport then load only shortly before they appear.
How can I exclude the LCP image from lazy loading in Magento 2?
You define how many images per page load immediately and mark exceptions by CSS class. The most important image can also get high priority.
How can I lazy load iframes in Magento 2?
The module switches iframes to deferred loading and shows a placeholder until then. For videos the player can start only after a click.
Does Magento 2 lazy loading prevent layout shifts?
The module adds missing width and height and reserves the space so the text does not jump when the image loads.
What happens in browsers without support?
The browser loads the image immediately and a noscript fallback keeps it visible even without scripts.
Are images from CMS blocks and the blog deferred as well?
Yes, the module works on the output HTML. Images from CMS, blog, page builder and product description are covered.
Can I switch off Magento 2 lazy loading per store view or page type?
Yes. The settings apply per store view and you can exclude single page types such as checkout.
Does Magento 2 lazy loading work with Hyvä?
Yes, it uses native browser features and needs neither jQuery nor an extra script. The Hyvä templates remain unchanged.
Does the module replace image compression?
No. It only controls the time of loading, not format or size of the files.
Can I download and install the module myself?
No. This offer is not a download product. After the purchase we install and configure the module personally in your shop.
Write Your Own Review
You're reviewing: Magento 2 Lazy Loading – Mironsoft Lazy Loading Images
loader
Loading...

You submitted your review for moderation.

This form is protected by reCAPTCHA - the Google Privacy Policy and Terms of Service apply.

Magento 2 Lazy Loading – Mironsoft Lazy Loading Images

Magento 2 Lazy Loading – Mironsoft Lazy Loading Images

€79.00