Support redirecting to Azure CDN #166
-
Currently we already have the In ImageProcessor.Web there was the option to redirect to the Blob Storage / CDN Endpoint on top of the Blog Storage instead of serving the image via the web application.
I looked a bit at the code to see how hard it would be to add this to the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
After more digging through the issues etc. I found the following. In this issue @JimBobSquarePants wrote:
This is a good point, so the current solution already allows for the case where the CDN is put in front of the application serving the image:
That being said I still think that there is a use case for the redirection based approach, because that is a lot simpler to setup for users. |
Beta Was this translation helpful? Give feedback.
-
As I described in the other issue you quoted you really don't want to do this. Basically you gain no localization benefit since the application has to process the request to do the 302 redirect to the endpoint. That's why a pass-through streaming option was added to ImageProcessor.Web (which I see you're familiar with and is possibly a driver for your request due to familiarity) The processing pipeline as you've listed is absolutely the best way to use a CDN with the middleware. Configuring your own application as a CDN endpoint is actually really simple. |
Beta Was this translation helpful? Give feedback.
-
For infos we quite successfully run all our ImageSharp.Web sites through a CDN, with the setup @JimBobSquarePants describes above. Probably the key component to it for us is using razor tag helpers to generate urls (and resizing / profiling information), which are able to read from This makes the move from development to production reasonably trivial. We find it works well for both the performance, plus the reduction in disc space from the |
Beta Was this translation helpful? Give feedback.
As I described in the other issue you quoted you really don't want to do this.
Basically you gain no localization benefit since the application has to process the request to do the 302 redirect to the endpoint. That's why a pass-through streaming option was added to ImageProcessor.Web (which I see you're familiar with and is possibly a driver for your request due to familiarity)
The processing pipeline as you've listed is absolutely the best way to use a CDN with the middleware.
Configuring your own application as a CDN endpoint is actually really simple.
https://docs.microsoft.com/en-us/azure/cdn/cdn-add-to-web-app it's a couple of text fields when you create your CDN.