Which is the best way to display image using image component? From /content or from /dam path? | Community
Skip to main content
Level 2
July 18, 2022
Solved

Which is the best way to display image using image component? From /content or from /dam path?

  • July 18, 2022
  • 2 replies
  • 577 views

Hi all,

 

Which is the best way to display image using image component?  From /content or from /dam path?

 

/content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png
or /content/dam/project/test.png ?  I think by default, foundational image component uses the dam location. Where as core image component uses the /content location.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi,

Content path -/content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

  • This will take care of serving images based on defined renditions without implementing any custom logic.
  • multiple cache for same assets based on page where is it used.

DAM Path - /content/dam/project/test.png

  • This will requires implementation serving images renditions based on DAM renditions.
  • 1 copy of cache

 

Both has advantages and disadvantages but surely you should go with /content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

 

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 18, 2022

Hi,

Content path -/content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

  • This will take care of serving images based on defined renditions without implementing any custom logic.
  • multiple cache for same assets based on page where is it used.

DAM Path - /content/dam/project/test.png

  • This will requires implementation serving images renditions based on DAM renditions.
  • 1 copy of cache

 

Both has advantages and disadvantages but surely you should go with /content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

 

Arun Patidar
DEBAL_DAS
New Member
July 18, 2022

I would like to add one point here -

If I follow /content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png content path, in that case the image gets saved at the page level rather than the DAM path , which makes it very hard to find in the future. Imagine now that the same high-res image is used in 10 places and, each time, users are uploading from their system: we are now stocking 10 images instead of saving it once in the DAM and referencing it 10 times.

 

Sharing following article: https://levelup.gitconnected.com/aem-forcing-the-use-of-the-dam-for-images-by-closing-loopholes-b102d944cad2

 

Debal Das, Senior AEM Consultant