This project is read-only.

Best Way to CDN key resources in Orchard

Topics: Customizing Orchard, Installing Orchard, Writing themes
Jan 30, 2013 at 12:31 PM

Hi Folks,

we are looking at using CDNs on our site to remove load, primarily content that is currently part of various themes (we have many themes and custom theme switching).

Within Orchard I can see that Script/Style.Require has a "useCDN()" method, but that seems best only for css and scripts. For image and other media content within a theme we need a different solution.

My understanding is that there is no way to change the theme location within Orchard, so we are considering other routes. Does anyone have experience trying to put themes onto CDNs? Our thought was to rewrite any URL containing  "/Themes/" with our CDN location, just before returning the page (kinda http module level I guess). The themes would also exist inside the normal Orchard location, so Orchard should not get upset.

Is there a better way to do this? Does anyone have experience of trying to do this that they can share?

Jan 30, 2013 at 1:34 PM

Would something like this work? 

You'd have to update all the url references in your themes to use the new extension method.