Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 57 lines (38 sloc) 2.644 kb
4258093 Tom Gallacher Adding bitcoin donation
tomgco authored
1 # gzippo
2
c6e854c Tom Gallacher Updating README.md
tomgco authored
3 gzippo pronounced `g-zippo` is a gzip middleware for Connect / expressjs using node-compress for better performace.
4258093 Tom Gallacher Adding bitcoin donation
tomgco authored
4
c6e854c Tom Gallacher Updating README.md
tomgco authored
5 gzippo currently only supports only gzipping static content files however a release is in progress to introduce streaming support.
4258093 Tom Gallacher Adding bitcoin donation
tomgco authored
6
7 ## Installation
8
9 $ npm install gzippo
10
11 ### Usage
12
13 In your express/connect server setup, use as follows:
14
15 var gzippo = require('gzippo');
16
17 //Replace the static provider with gzippo's
18 //app.use(express.static(__dirname + '/public'));
19 app.use(gzippo.staticGzip(__dirname + '/public'));
20
21 Options:
22
23 - `matchType` - A regular expression tested against the Content-Type header to determine whether the response should be gzipped or not. The default value is `/text|javascript|json/`.
24 - `maxAge` - cache-control max-age directive, defaulting to 1 day
25
26 Currently the gzipped version is created and stored in memory. This is not final and was done to get a working version
27 up and about. A version which will gzip text/html after res.render() / res.end() is in progress.
28
29 [node-compress](https://github.com/waveto/node-compress) gzip library is used for gzipping.
30
c6e854c Tom Gallacher Updating README.md
tomgco authored
31 Found gzippo helpful? Why don't you [tip us](http://tiptheweb.org/tip/?link=https%3A%2F%2Fgithub.com%2Ftomgallacher%2Fgzippo&title=Tip%20to%20Support%20gzippo) [![Flattr Button](http://api.flattr.com/button/button-compact-static-100x17.png "Flattr This!")](https://flattr.com/thing/282348/gzippo-node-js-gzip-module "gzippo - node.js gzip module")
32 Bitcoin me: 1DnVpXSGubdyBSbyuJZNMNzkAVrwPJhaUL
33
4258093 Tom Gallacher Adding bitcoin donation
tomgco authored
34 ## License
35
36 (The MIT License)
37
38 Copyright (c) 2011 Tom Gallacher &lt;<http://www.tomgallacher.info>&gt;
39
40 Permission is hereby granted, free of charge, to any person obtaining
41 a copy of this software and associated documentation files (the
42 'Software'), to deal in the Software without restriction, including
43 without limitation the rights to use, copy, modify, merge, publish,
44 distribute, sublicense, and/or sell copies of the Software, and to
45 permit persons to whom the Software is furnished to do so, subject to
46 the following conditions:
47
48 The above copyright notice and this permission notice shall be
49 included in all copies or substantial portions of the Software.
50
51 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
52 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
53 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
54 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
55 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
56 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
57 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.