Implementation of lazy loading for off-screen images using the loading="lazy" attribute for embed option

Created on 19 June 2025, 13 days ago

Problem/Motivation

This issue proposes the implementation of lazy loading for off-screen images in the Acquia DAM. By adding the loading="lazy" attribute to the embed option for images, we can enhance the performance of web pages by deferring the loading of images that are not immediately visible in the viewport. Currently it is available with download and sync option.

Steps to reproduce

Install Drupal
Install Acquia DAM & media_library
Authenticate site in the configuration and then authorize the user
Create Content type and add media field with Acquia DAM: Image bundle selected.
Edit Acquia DAM: Image media type and check the Download and sync option & save changes.
Create page and add DAM assets.
Verify the loading="lazy" attribute is available with image tag.
Edit Acquia DAM: Image media type and uncheck the Download and sync option & save changes.
Visit page and verify the loading="lazy" attribute is not available with image tag.

Proposed resolution

Add the image_loading attribute into the EmbedCodeFormatter.

💬 Support request
Status

Active

Version

1.1

Component

Code

Created by

🇮🇳India rajeshreeputra Pune

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024