Yii Cdn For Assets


I am planning to use CDN for my static content (js, css, images etc.). So it would be great if anyone could guide me with this.


Main website runs on, http://www.mywebsite.com

CDN can be either http://cdn.mywebsite.com or http://cdn.something-other-than-amazon.com. This content may or maynot be present on same physical server.

Hi Mayur,

Take a look at the s3assetmanager extension.

As I already mentioned I want to use my own CDN other than Amazon.

I don’t understand what you mean by CDN.

Do you mean just using another, cookieless domain?

Please elaborate so we can help you.

CDN = Content Delivery Network. It is cookieless e.g. static.mywebsite.com (Not Amazon CloudFront) hosts all static files and propagates to various nodes (Geographically seprated).

So what I need is all static data (js and css) on http://www.mywebsite.com should come from http://static.mywebsite.com [Hosted on some other physical machine].

In this case, I believe that you can check the source code of the extension for inspiration on how to extend CAssetManager to copy your files via whatever method to your CDN upon asset publishing.

Im interested in this topic too, do you get something interesting Mayur? thanks