Javascipt server-side compression merge

  java, javascript

The page uses multiple javascript, first optimize it, and want to compress and merge these js files on the server side.
Pass on front page

<script>
 KISSY.getScript('http://a.tbcdn.cn/??apps/tcc/recharger/build/20130115/tb_home/phone-min.js,s/kissy/gallery/local-storage/1.0/index-min.js')
</script>

In a similar way (Taobao’s approach).
I don’t know how the backstage handled it.
The most crucial question is:I requested to go to the background, get parameters, read those files, compress and merge them, generate new files, and then how do I return them to the client? ? ?

Taobao should have used the features of tengine.http://tengine.taobao.org/

Mod_concat module This can combine multiple requests into one request.
http://tengine.taobao.org/document_cn …

Here is an article on how to use it.
http://www.cnblogs.com/fuyunbiyi/arch …

The request parameter requires two question marks (‘? ?’ ) to activate the concat feature. multiple files are connected by commas (,)

<script type="text/javascript" src="??js/jquery.js,js/slide_original.js,count/count/count.js"></script>
这样,便可以将jquery.js 和 slide_original.js 以及 count.js三个js文件的请求合并为一个了。