Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

AEM 6.5.11 AMS || All the Image tags always renders loading=lazy in the html even though we are not using image core component

Avatar

Level 1

Hello,

 

All the Image tags always renders loading=lazy attribute in the html even though we are not using image core component.

 

Note: I have not used AEM core components nor hard coded the attribute in the html.

 

We are using dynamic media for image renditions.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@SHATARIG ,

I tried replicating it, I couldn't see the lazy attribute to my image tags.
Just in case, see if your component has a super resource type.

can you give us an example of your code snippet?

Luckily, in the latest image component (V3) verison, Adobe added an option to disable lazy loading.

View solution in original post

3 Replies

Avatar

Community Advisor

@SHATARIG 

By default, AEM does not add the loading="Lazy" attribute to image tags. The loading="Lazy" attribute needs to be explicitly added to the image tags in the HTML code.

 

  1. Edit the component's dialog or template: If you have access to the component's dialog or template, review the HTML code to see if the loading="Lazy" attribute is being added there. Look for any custom logic or scripts that might be automatically adding this attribute.

  2. Check the AEM configuration: AEM provides various configuration options that can affect the rendering of HTML. Look for any specific configurations related to image handling or lazy loading in your AEM instance.

  3. Custom code or scripts: If you have any custom code or scripts running on your AEM instance, they could be responsible for adding the loading="Lazy" attribute to image tags. Review your custom codebase for any logic related to image handling or lazy loading. 

Avatar

Correct answer by
Community Advisor

@SHATARIG ,

I tried replicating it, I couldn't see the lazy attribute to my image tags.
Just in case, see if your component has a super resource type.

can you give us an example of your code snippet?

Luckily, in the latest image component (V3) verison, Adobe added an option to disable lazy loading.

Avatar

Community Advisor

I agree with @B_Sravan  even i tried in my local and unable to replicate the issue. If should be loading from your custom code @SHATARIG