Developer forum

Forum » Feature requests » CDN-implementation - replace domain for static files

CDN-implementation - replace domain for static files

Jacob Bertelsen
Reply

Hi DW,

We are currently implementing CDN on a DW solution.

Any thoughts on making it possible to name a CDN-domain somewhere in MC, which the template engine will use for static files?

A nice example:

www.dynamicweb.dk has a reference to this file:
/Files/Templates/Designs/espresso/css/custom.css
Effectively the browser will download the file from this path:
http://www.dynamicweb.dk/Files/Templates/Designs/espresso/css/custom.css

In order to make CDN-implementation easier, it would save some time, if there was a field in the MC, where I could type "cdn.dynamicweb.dk" , and the path would end up being:
http://cdn.dynamicweb.dk/Files/Templates/Designs/espresso/css/custom.css .

Whether or not getimage.ashx should run before or after, I am sure you know better than me :)

Is this functionality in your roadmap?
If not, do you have any plans to add it to your roadmap?


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Jacob

With the attached add-in, you can add a CDN host in /Files/Globalsettings.aspx manually that will enable CDN for images:

<System>
    <cdn>
      <active>True</active>
      <host>http://cdn.dynamicweb-cms.com</host>
    </cdn>
</System>

Then all <img src=”/Files/image.jpg”> will be changed to <img src=”http://cdn.dynamicweb-cms.com/Files/image.jpg”>

For images running with GetImage.ashx, this of course cannot work. GetImage would not be able to download files from an external source. Then you would have to install GetImage.asxh (and DW) on the CDN server.

You can update the regex in the addin to also take care of js and css resources.

Nicoloai