Setupped the site to use Azure Blob Storage for Media, and it's working fine, but when we try to serve media via CDN, then it is not working as expected.
This enables ImageSharp to resize the image and return this processed image back to the CDN which caches it for subsequent requests hence needing the cache each url uniquely option you highlight to be turned on...
Common issues are usually that the CDN is set up directly to blob storage... And so there is nothing to handle the resize request! Or the cache unique checkbox isn't ticked when the CDN is first launched and so the CDN needs to be purged for the change to take affect!
Image is not getting cropped via Azure CDN
Hi,
Setupped the site to use Azure Blob Storage for Media, and it's working fine, but when we try to serve media via CDN, then it is not working as expected.
The Media cropper is not working via CDN URL.
CDN URL
CDN Profile screenshots - Cache every Unique URL
Regards
Dhanesh
Hi Dhanesh
Is the CDN set up direct to the blob folder or via your website?
So if a request comes into the CDN...
https://cdn.mysite.com/media/1234/myimage.jpg?width=150
Then this should request the image via the website eg.
https://www.mysite.com/media/myimage.jpg?width=150
This enables ImageSharp to resize the image and return this processed image back to the CDN which caches it for subsequent requests hence needing the cache each url uniquely option you highlight to be turned on...
Common issues are usually that the CDN is set up directly to blob storage... And so there is nothing to handle the resize request! Or the cache unique checkbox isn't ticked when the CDN is first launched and so the CDN needs to be purged for the change to take affect!
Regards
Marc
Thanks Marc,
Ah, I got it, I change the origin of the CDN profile to the WebApp instead of Blob Storage and now the media is getting cropped.
There is a small issue with the package, the container name is automatically appended along with the CDN URL because of this
eg: https://cdn.url/containername/media... and return 404.
But we can fix this by configuring the AddCdnMediaUrlProvider, it takes a callback where I can configure the options like below.
Regards
Dhanesh
is working on a reply...