Hello,
Here is some context :
I am developing a static website hosted on a azure storage account.
The images for this website are located in the storage account in a folder at the same place as the html/js/css files.
Those images are stored in their base format and have already been converted to the webp format.
So for every images, there is a second image with the same name but not the same format (image1.jpg and image1.webp for example)
All the files are served throught a Microsoft Azure CDN (not Verizon nor Akamai).
Now, here is my problem :
When a request to get an image from the storage account is made, if the header of the request contains image/webp in the accepted format, then I want to get the webp formated image instead of the base format.
For example :
1. A request is made to get the image named image1.jpg
2. The request headear contains accept: image/webp
3. There is an image named image1.webp in the storage account
4. The CDN returns image1.webp instead of image1.jpg
In this example, image1.jpg should be retrieved only if image1.webp doesn't exist on the storage account or if the headear doesn't contains accept: image/webp.
Currently, I have tried a lot things, but the CDN always return the image in it's base format even if all the conditions are met.
Since there is a similar functionality that already works for getting compressed files in fomats like gzip or br instead of html/css/js for the website files, I think there is no reason that it's impossible to do with image formats.
So what am I missing, is there a way like redirecting the response or rewriting the URL through a rule, or maybe just a parameter somewhere to make that work. Or is it just impossible with a Microsoft CDN ?
Thanks by advance for your help ;)