Multiple fetch of combined JS

Hey,

i use a scriptmap in my main.php.




'clientScript'=>array(

        	'scriptMap'=>array(

            	'jquery.js'=>false,

            	'jquery.ajaxqueue.js'=>false,

            	'jquery.metadata.js'=>false,

            	'jquery.ba-bbq.js'=>false,

            	'bootstrap-transition.js'=>'js/bootstrap-combined.js',

            	'bootstrap-tooltip.js'=>'js/bootstrap-combined.js',

            	'bootstrap-popover.js'=>'js/bootstrap-combined.js',

            	'bootstrap-alert.js'=>'js/bootstrap-combined.js',

            	'bootstrap-collapse.js'=>'js/bootstrap-combined.js',

            	'bootstrap-dropdown.js'=>'js/bootstrap-combined.js',

        	),

    	),



I thought with this scriptmap i decrease the count of request per page. But instead, my bootstrap-combined.js is loaded multiple time, so that the request count is almost as high as without the map. Is there anything wrong with the map or did i misunderstood the use of the map.

You can find the result in firebug in the image attached.

I’m just guessing so I may be wrong.

scriptMap is generally used to change scripts that are part of Yii (like jQuery) with another version or turn them off, if you don’t use them.

I’ve never heard about using scriptMap for reducing page load, except the way that use force Yii to use CDN-version of jQuery for example, instead of own, local copy of it.

Have you search the forum or read documentation on scriptMap?

With the use of scriptMap you can map multiple files to one, described in this article: http://www.yiiframework.com/doc/guide/1.1/en/topics.performance#minimizing-script-files

But thanks for the guess :)