Reproducible steps (1... 2... 3...) that cause the issue
This issue is only seen when on a our scaled environments that use the Azure CDN. The issue is not seen on dev environments that don't use the CDN. I suspect this might not be a Dianoga issue but instead an Azure CDN issue. In some research, I see that Azure CDN does not return the "Accept" header. When looking at a single image request in Chrome Dev Tools, I see "Accept" in the request headers (value: "image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8") but I do not see it in the response headers.
In this environment I do not see the "webp" appended to the query string of the image requests as expected.
If Azure CDN is not respecting/returning the "Accept" header, can you confirm that would cause this issue I am seeing?
What you expected to see, versus what you actually saw
Browsers are not receiving webp images as expected.
Relevant logs
Nothing in the Dianoga logs or Sitecore logs to indicated errors. I do see optimizations taking place as expected in Dianoga logs. I can see those optimized images being served by matching download size in Chrome Dev Tools to the optimized size reported in the log.
Version of Dianoga
6.0.1
Environment description
Scaled Sitecore 9.2, SXA, Hosted on Azure (Sitecore Managed Cloud)
What configs you have enabled
Web.config: add verb="*" path="sitecore_media.ashx" type="Dianoga.NextGenFormats.MediaRequestHandlerXA, Dianoga" name="Sitecore.MediaRequestHandler"
Reproducible steps (1... 2... 3...) that cause the issue
This issue is only seen when on a our scaled environments that use the Azure CDN. The issue is not seen on dev environments that don't use the CDN. I suspect this might not be a Dianoga issue but instead an Azure CDN issue. In some research, I see that Azure CDN does not return the "Accept" header. When looking at a single image request in Chrome Dev Tools, I see "Accept" in the request headers (value: "image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8") but I do not see it in the response headers.
Additionally, this post confirms that Azure CDN does not support the "Accept" header: https://docs.microsoft.com/en-us/answers/questions/594279/azure-cdn-does-not-forward-accept-header-to-origin.html
In this environment I do not see the "webp" appended to the query string of the image requests as expected.
If Azure CDN is not respecting/returning the "Accept" header, can you confirm that would cause this issue I am seeing?
What you expected to see, versus what you actually saw
Browsers are not receiving webp images as expected.
Relevant logs
Nothing in the Dianoga logs or Sitecore logs to indicated errors. I do see optimizations taking place as expected in Dianoga logs. I can see those optimized images being served by matching download size in Chrome Dev Tools to the optimized size reported in the log.