Select all that apply. What can you do to optimize images within a custom module?

Question: Select all that apply. What can you do to optimize images within a custom module?

  • Set the image's loading attribute to "lazy," by default
  • Add width and height attributes to the image
  • Use the resize_image_url function to resize the image
  • Use srcset and sizes attributes

Explanation

All of the listed techniques are valid because HubSpot documents each one as part of image optimization in custom modules. HubSpot supports browser-native lazy loading on image fields through the loading attribute, which helps defer offscreen images. HubSpot’s performance guidance also recommends adding width and height so the browser can reserve space and reduce Cumulative Layout Shift. When the markup is controlled directly, HubSpot recommends resize_image_url to serve more appropriate image sizes and notes that custom srcset and sizes can further improve delivery efficiency. Together, these changes reduce unnecessary image payload and improve rendering stability. HubSpot Developers+3HubSpot Developers+3HubSpot Developers+3

Why the other options are incorrect

None of them are incorrect because each listed choice is a documented image optimization technique for HubSpot custom modules. HubSpot Developers+3HubSpot Developers+3HubSpot Developers+3

Source for verification

HubSpot Developer Documentation: Optimizing your HubSpot CMS site for speed. HubSpot Developers+1

HubSpot Developer Documentation: Lazy loading assets for performance. HubSpot Developers+1

The answer(s) to the question is highlighted in the BOLD text above. You can also find more questions and answers related to the exams on the "HubSpot CMS for Developers II" page.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top