-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webp content-type not returned when CDN enabled #113
Comments
I have prepared a branch, where it could be easily tested on Docker containers. Quick steps to reproduce:
Expected result: The issue should be fixed in this PR: |
Fixed in 6.0.1 |
@markgibbons25 Thanks for looking into this issue! I tried the new 6.0.1 installation and replaced all files and configs; however, I still don't see the content-type being reflected on CD with CDN. As usual, CM without CDN is fine. Please advise. Also, is there a way to force ".webp" extension. Currently if a jpg file is deemed "doesn't need to be optimized," original jpg file format is returned which is not ideal in our case. In addition, looking at the above change in the "5ccab10" pull request, we had to comment off "mediaProvider /site/wwwroot/App_Config/Include/Dianoga 2864 20:39:07 INFO Dianoga: optimized /Images/Homepage/ic_volunteer_program.jpg [original size: 114925 bytes] [final size: 54913 bytes] [saved 60012 bytes / 52.22 %] [Optimized in 304ms] [Extension jpg] |
Hi @kwyc Unfortunately, there is no way to force Dianoga to know about the support of browser of Let me explain whyThe request comes to Sitecore in this order. How it is possible to define if browser supports
|
@Antonytm Thanks for the detail explanation! I have tried 6.0.1 again and noticed that "?extension=webp" is not being appended to image urls even when the pipeline is enabled. Which tells me "extensions" variable is empty. Any thoughts on why that value is empty? Also I've also tried to manually call image.jpeg?extension=webp on the CDN server and can confirm that content-type does return "content-type: image/webp" if the url is manually called. Perhaps it is related to this issue, |
You need to figure out what headers are available on the server. Probably CDN cleans them up. Expected: the presence in accept header |
@Antonytm Thanks for your feedback, seems like it is an on-going issue with Azure FrontDoor. We will look into having FD to rewrite image urls from image.jpeg to image.jpeg?extension=webp |
@Antonytm Thanks for your assistance we finally got image/webp content-type returned on CDN! For anyone that's curious, we added a FD rewrite rule to append "?extension=webp". |
Issue with adding a FD rewrite rule to append "?extension=webp" on every request is you are essentially forcing webp even on browsers that can't use it. The good news is that all evergreen browsers now support webp https://caniuse.com/webp except for Safari on MacOs <10 |
Version of Dianoga
6.0.0
Environment description
Production Sitecore 9.3
What configs you have enabled
Production CD:
Production CM:
Reproducible steps (1... 2... 3...) that cause the issue
Load CDN site vs non-CDN site and check content-type on .webp images. Expect image/webp instead of image/jpeg.
What you expected to see, versus what you actually saw
On CD, when CDN is enabled,
Expected to see image/webp instead of image/jpeg.
On CM, when CDN is disabled,
image/webp is returned which is correct behaviour.
GenerateCacheKey orders seems correct.
Relevant logs
Following up from closed issue,
#110
The text was updated successfully, but these errors were encountered: