Total Pageviews

Wednesday 19 February 2014

Comboserver

Comboserver serves multiple files combined in a single request.

INSTALLATION

From source with Go 1.1+:

  $ go get http://github.com/dchest/comboserver/comboserver


USAGE
  Usage: comboserver <directory>
    -addr="localhost:8080": address to serve content from
    -maxfiles=50: maximum files to concatenate in a single request
    -root="/": root URL
    -sep="&": file list separator

Example:

 $ comboserver -addr=localhost:8081 -root=/combo /var/www

This will launch a web server serving files from /var/www. Suppose it
contains the following files:

    base.css
    pure/grids.css
    pure/buttons.css
    
Then these files, concatenated, are available with a single request:

    http://localhost:8081/combo?base.css&pure/grids.css&pure/buttons.css

Files can be combined in any way:

    http://localhost:8081/combo?pure/buttons.css&base.css

The program preserves the order of request, doesn't allow repeated
filenames, and limits the number of files to 50 by default. Content-type
header of response is set to the type of the first file in list.

Comboserver doesn't do any caching, as it's a job of whatever nginx you put
in front of it.
 
from  https://github.com/dchest/comboserver