File: content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/site/js/imageDynamicMedia.js
In setDMAttributes, the src variable has DPR applied before being passed to getSrcSet:
var src = properties.src.replace(SRC_URI_DPR_OFF, SRC_URI_DPR_ON);
src = src.replace(SRC_URI_TEMPLATE_DPR_VAR, dpr); // e.g. dpr=on,2
This produces srcset entries like:
https://dm.example.com/image?dpr=on,2&w=400 400w,
https://dm.example.com/image?dpr=on,2&w=800 800w
The w descriptor is supposed to tell the browser the intrinsic pixel width of the image. But dpr=on,2 tells Dynamic Media to serve an image that is width * 2 physical pixels wide. So the 400w entry actually delivers an 800px image - the browser is being lied to about the size and will over-fetch.
for dpr=2 srcset should be something like this:
https://dm.example.com/image?dpr=on,2&w=400 800w,
https://dm.example.com/image?dpr=on,2&w=800 1600w
File:
content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/site/js/imageDynamicMedia.jsIn
setDMAttributes, thesrcvariable has DPR applied before being passed togetSrcSet:This produces srcset entries like:
The
wdescriptor is supposed to tell the browser the intrinsic pixel width of the image. Butdpr=on,2tells Dynamic Media to serve an image that iswidth * 2physical pixels wide. So the400wentry actually delivers an 800px image - the browser is being lied to about the size and will over-fetch.for
dpr=2srcset should be something like this: