Css Files:

CSS files are merged based on there media attribute, background images with
a relative path in file can also be displayed correctly.

Script files:

Script files are merged based on their position, If you use the 'CClientScript::POS_HEAD'
you will end up with a single file for all the script files you've used on that page.

If you use 'CClientScript::POS_HEAD' and 'CClientScript::POS_END' for example then
you'll end up with two files for each page on that request, becuase those resources
are located in different positions.

File optmization (EXPERIMENTAL, @since: 1.1)

CssMin used to optimize merged css file.
You can set property 'optmizeCssFiles' of the component to enable this feature.
JSMinPlus used to optimize merged script file.
You can set property 'optmizeScriptFiles' of the component to enable this feature.

Using this extension is as simple as adding the following code to
the application configuration under the components array:

'clientScript' => array('class' => 'application.vendors.yii-EClientScript.EClientScript',
'combineScriptFiles' => !YII_DEBUG, // By default this is set to true, set this to true if you'd like to combine the script files'combineCssFiles' => !YII_DEBUG, // By default this is set to true, set this to true if you'd like to combine the css files'optimizeScriptFiles' => !YII_DEBUG, // @since: 1.1'optimizeCssFiles' => !YII_DEBUG, // @since: 1.1'optimizeInlineScript' => false, // @since: 1.6, This may case response slower'optimizeInlineCss' => false, // @since: 1.6, This may case response slower),

Then you can use the regular 'registerScriptFile' & 'registerCssFile' methods as normal
and the files will be combined or optimized automatically.

Using to conditional loading js/css file for IE browser,
you just need to specify the media property.

If you registered some external resource files that not in the web application root directory,
they will be kept and not combined. Compression or optmization is a EXPERIMENTAL feature,
please use it carefully(@since: 1.1)

Hi I have been using your extension for a little while now and all seemed fine until I ran out of web space yesterday. I only use the "'combineCssFiles' => true" and all others false as it was breaking some things.

however it turns out that the script is creating a brand new version of the compbined css on every single page load/refresh, it isnt caching at all, after 3 months I had used up all my web space (30 gig) and thats because there was 29 gig of combined css files in the assets folder.

I have the extension in the protected/extension folder and I have the following added to my main.php config file

'clientScript' => array('class' => 'ext.minify.EClientScript',
'combineScriptFiles' => false, // By default this is set to true, set this to true if you'd like to combine the script files'combineCssFiles' => true, // By default this is set to true, set this to true if you'd like to combine the css files'optimizeScriptFiles' => false, // @since: 1.1'optimizeCssFiles' => false, // @since: 1.1'optimizeInlineScript' => false, // @since: 1.6, This may case response slower'optimizeInlineCss' => false, // @since: 1.6, This may case response slower'coreScriptPosition' => CClientScript::POS_END,
'defaultScriptPosition' => CClientScript::POS_END,
'defaultScriptFilePosition' => CClientScript::POS_END,
),

There are number of libraries which depends on js file location to fetch other resources relatively. Common example is CKEditor which loads css, images, and other files relatively to 'ckeditor.js' location.
When you merge this js to one file with others - CKEditor won't work.

My solution (I did such modyfication to make it work and use combined js feature):

provide 'public $whiteList = array()' configuration attribute in your component, and change piece of code that decides wheter to merge css/js entry or not. I have changed getLocalFile function to getLocalFileNotWhitelisted with body like this:

Can you keep the original order of the files that combined or not into one single file? In addition, if you choose some combination, some do not mix, it is difficult to do all in order to keep the original, so that it will generate an error, for example, CSS class application.