Try our conversational search powered by Generative AI!

Using a CDN with Episerver

Ayo
Ayo
Vote:
 

I have an existing Episerver project, all the images and media are genrally uploaded via the back office's media section.

Recently they have significantly inrecressed the amount of media on the website, and are considring, using some kind of CDN to serve the content.

Is it possible to use a CDN with episerver - I would like the back office users not to have to do anything diffrent than they do now, so still upload the images in the normal way.

Has anyone ever done something like this? where do I start?

#191884
May 02, 2018 12:51
Vote:
 

Here are some helpful links: 

https://world.episerver.com/documentation/developer-guides/CMS/Deployment/content-delivery-network-cdn-configuration/ 

https://world.episerver.com/digital-experience-cloud-service/development-considerations/cdn-recommendations/

http://azanganeh.com/blog/2017/03/22/what-is-cdn-and-how-it-fits-to-episerver-solution-part-2-setup-cloudflare/

https://getadigital.com/blog/add-azure-cdn-or-any-cdn-to-your-episerver-site/

#191909
May 02, 2018 15:57
Vote:
 

We have used Azure CDN with success. Upload the same way as always but serving the urls from azure with tranformations in web.config for images. We used the same approach as @aniket mentioned in the last link to Getadigital.

It is also possible to use "poor mans cdn" like this solution: https://github.com/bjuris/EPiServer.CdnSupport

This will make image served from a diffrent url making it possible to download more content at the same time for the visitor since you can serve it from a diffrent domain. We have used this as well.

#191913
May 02, 2018 16:39
Vote:
 

I would recommend Cloudflare (https://www.cloudflare.com/) - there is no extra configuration or coding necessary, you just need to make sure the headers are correct.

#192050
May 04, 2018 9:06
Vote:
 

EPiServer.CdnSupport mentioned above is recommended to use with Cloudflare (or any origin-pull style CDN) and not just for rewriting URLs to another domain name.

#192113
May 07, 2018 21:47
Vote:
 

Hi! This helped me alot images, js, css, imagevault images is now served over CDN

What about things like this can it be served over cdn?

Now its served over

mydomain.com/static/js/bundles?v=ycPr38eUkrewZfJbNfq1X65zpxlWB4O0ceFYSNBJNis1

mydomain.com/static/css/bundles?v=5kUKCeY-jkF4jDFYUF6Y5XEHYP_niXLJYNQ5M9Itet01

but i want it to be served over

cdn-mydomain.com/static/js/bundles?v=ycPr38eUkrewZfJbNfq1X65zpxlWB4O0ceFYSNBJNis1

cdn-mydomain.com/static/css/bundles?v=5kUKCeY-jkF4jDFYUF6Y5XEHYP_niXLJYNQ5M9Itet01

#222489
May 06, 2020 14:29
Vote:
 

If you are using the CdnSupport-project I linked above you just do:

<appSettings>
  <add key="episerver:CdnExternalMediaUrl" value="http://static.site.com/"/>
</appSettings>
#222502
May 06, 2020 14:36
Vote:
 

When i add this Episerver.CdnSupport package i get this urls

https://mydomain/499480/globalassets/3876714204.jpg

If i add the 

<appSettings>
  <add key="episerver:CdnExternalMediaUrl" value="https://cdn-mydomain.azureedge.net/"/>
</appSettings>

I get this urls

https://cdn-mydomain.azureedge.net/499480/globalassets/3876714204.jpg

And the bundles are still served as 

https://cdn-mydomain.azureedge.net/static/js/bundles?v=ycPr38eUkrewZfJbNfq1X65zpxlWB4O0ceFYSNBJNis1

https://cdn-mydomain.azureedge.net/static/css/bundles?v=5kUKCeY-jkF4jDFYUF6Y5XEHYP_niXLJYNQ5M9Itet01

So the cdn package seems to work because its adding the hash /499480/ and the cdn url but it cant resolve the new link so its not working with the bundles or the cdn link created. Any suggestions? 

#222546
Edited, May 07, 2020 12:27
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.