Nginx-concat-Module 减轻http请求连接数
http://blog.zongzk.com/index/archives/742
?
Nginx_concat_module是淘宝(JoshuaZhu)开发的基于Nginx减少HTTP请求数量的扩展模块,主要是用于合并减少前段用户Request的HTTP请求的数量。
taobao.com
安装?nginx_concat_module?需要重新编译?nginx。可以从这里?checkout?最新的代码,
svn?checkout?http://code.taobao.org/svn/nginx_concat_module/trunk/?$NGINX_CONCAT_MODULE
然后下载适合你自己版本的?nginx?源码包,在?./configure?中增加参数
add-module=$NGINX_CONCAT_MODULE? ? ??cd /us/local/src
wget?http://nginx.org/download/nginx-1.0.10.tar.gztar xzvf?nginx-1.0.10.tar.gzcd?nginx-1.0.10/./configure user=www group=www ?prefix=/usr/local/nginx with-http_stub_status_module ?with-http_sub_module ? ?with-http_flv_module ? with-http_gzip_static_module ? add-module=../nginx_concat_module/ ?&& make && make install使用方法:
- location?/temp/ {?????????????????# 打开concat 功能?????????????????# 默认关闭?????????????????concat?on;?????????????????# 允许concat最大的文件数(http://www.zongzk.com/temp/??1.css,2.css,3.css…10.css) 默认最大设置十个文件。?????????????????# (默认:?10)?????????????????# concat_max_files 10;?????????????????# 只允许相同类型的文件(例:http://www.zongzk.com/temp/??zzk.css,zongzk.js 默认情况下是不允许的)?????????????????# 默认是开启的?????????????????# concat_unique?on;?????????????????# 允许内容的类型?????????????????# (default:?application/x-javascript,?text/css)?????????????????# concat_types text/html;????????}
- #for i in {1..100};do echo “$i” > ./”$i”.css ;done