aem-core-wcm-components icon indicating copy to clipboard operation
aem-core-wcm-components copied to clipboard

[Image v3] #2263: Add fetchpriority attribute support

Open aldunchev opened this issue 3 months ago • 2 comments

Q                       A
Fixed Issues? Fixes #2263
Patch: Bug Fix? no
Minor: New Feature? Yes
Major: Breaking Change? no
Tests Added + Pass? Yes
Documentation Provided Yes (code comments and or markdown)
Any Dependency Changes? No
License Apache License, Version 2.0

Add fetchpriority attribute support to Image component (v3)

Implements fetchpriority attribute for the Image component to optimize Largest Contentful Paint (LCP) performance.

Changes:

  • Added policy-level configuration in design dialog (default fetchpriority + override toggle)
  • Added component-level override in edit dialog
  • Implemented decision logic: component value overrides policy value (if allowed)
  • Added getFetchPriority() method and updated getHtmlAttributes() in Image interface
  • Added 5 unit tests covering all scenarios

Usage:

Template authors can set default fetchpriority ("high", "low", "auto") in policies and optionally allow content authors to override per component. Useful for marking hero images as "high" priority to improve LCP.

Fixes #2263

aldunchev avatar Oct 16 '25 13:10 aldunchev

Here is the checkbox to allow the authors to change the fetchpriority attribute: image

The fetch priority on the image: image

The final result: image

aldunchev avatar Oct 16 '25 13:10 aldunchev