Skip to content

awayhe/ngx_http_combo_module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

for more infomation about combo idea, visit this blog:
http://www.yuiblog.com/blog/2008/07/16/combohandler/

*INSTALL
cd nginx-a.b.c
./configure --add-module=path/ngx_http_combo_module
make
make install

*CONFIG
server {
	...

	location /foo {
		# enable combo module
		combo on;
		# set combo file limit. default is 10
		combo_limit 10;
		# set if enable different file extension combo together. default off
		combo_mix_ext off;
		# set if enable try foo.js if foo.20120114.js is not exist. default off
		combo_strip off;
		# seperator of url. default is '?&'.
		combo_seperaor '?&';
		# limit file extension. default '.js .json .css .html .txt'.
		combo_exts '.js .json .css .html .txt';
		
		...
	}
}

*ABOUT combo_seperator
combo_seperator make it possible to define your own url formats.
here is some samples to understand this configuration:
'?&'      /foo?a.js&b.js&c.js
'?&!'     /foo?a.js&b.js&c.js!20120114
'(&)'     /foo(a.js&b.js&c.js)20120114
'!;!'     /foo!a.js;b.js;c.js!20120114

*PATH
in some enviroment, the comboed files all in one path, or almost in one path, for example, we need combo these files:
------------------------------------
js/plugin/p1.js
js/plugin/p2.js
...
js/core.js
js/core2.js
...
common.js
--------------------------------------
path prefix 'js/plugin/' wastes too much. Here is a way to shorten the request uri:
http://host/combo?js/plugin/&p1.js&p2.js&p3.js&p4.js&p5.js&js/&core.js&core2.js&&common.js

Here is the rules:
1. when a file last char is '/', it means this is a path prefix to the next files;
2. an empty file such like '&&' upon, means reset prefix.


About

A Yahoo!-style combo module for nginx.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages