Cookieless domain for static content

Hi all,

which is the best way to implement a cookieless domain for serving all static contents in Yii?

For example, if my domain is www.example.com and I want images, css, etc. served by www.example-static.com, which is a cookieless domain, should I do something like changing Yii::app()->theme->baseUrl then use it for referencing all static contents?

Regards

Enrico

I would use static.example.com. You can easily implement it with this extension. You may modify the extension a little. Currently you have to do:


$imgsrc = yii::app()->parallelized->getParallelizedHost() . 

          yii::app()->baseUrl . '/images/img0020.jpg';

this would be better imo:


$imgsrc = yii::app()->parallelized->baseUrl() . '/images/img0020.jpg';

Thank you. Actually I don’t need the parallelization part (we have a hardware network balancer), so I’ll just add http://static.example.com/ to all images and css urls.

Regards

Enrico

I think it’s better to add this facility to CWebApplication, and manage assets this way