This generates that url by saving the result of the first 302 redirect in the application cache to ensure subsequent redirects are not required.
Predicting the url itself without testing for the existance is extremely difficult since the generated url depends on multiple factors like filesize, last write time etc.
How do I get the CDN URL of a cached image?
Hi,
I need to create a report with a bunch of images from my site. The images are to be of a certain size so I need to crop them first.
I have the images stored on Azure Blob Storage and I also have a CDN enabled.
I would like to put the CDN or at least the Azure storage URL in the report, rather than the original URL with the crop instructions in the URL.
Is there any way to determine the URL of the cached processed images that a browser would eventually be redirected to?
Thanks, Paul.
Hi Paul,
Have you seen this thread perhaps this can help you a step furhter
https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/76696-imageprocessor-for-azurecloudstorage-breaks-website
Hope this helps,
/Dennis
Hi Paul,
Opening the image in a new tab will give you the CDN url since it will perform a 302 redirect.
In the future if you want to render the CDN url directly in your webpage I would advise you to have a look at the Azure CDN Toolkit
https://our.umbraco.org/projects/developer-tools/azure-cdn-toolkit-for-umbraco/
One of the overloads within that package allows you to render the CDN url if it exists, falling back to the blob storage url if not propagated.
This generates that url by saving the result of the first 302 redirect in the application cache to ensure subsequent redirects are not required.
Predicting the url itself without testing for the existance is extremely difficult since the generated url depends on multiple factors like filesize, last write time etc.
Hope that helps
James
is working on a reply...