Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 59 lines (39 sloc) 2.713 kB
4258093 @tomgco Adding bitcoin donation
tomgco authored
1 # gzippo
2
17ca150 @tomgco Updating README.md
tomgco authored
3 gzippo pronounced `g-zippo` is a gzip middleware for Connect / expressjs using node-compress for better performace.
4258093 @tomgco Adding bitcoin donation
tomgco authored
4
17ca150 @tomgco 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 @tomgco 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
c50384c @jhuckabee Fix matchType references with contentTypeMatch
jhuckabee authored
23 - `contentTypeMatch` - 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/`.
4258093 @tomgco Adding bitcoin donation
tomgco authored
24 - `maxAge` - cache-control max-age directive, defaulting to 1 day
d370626 @tomgco Adding client max age directives
tomgco authored
25 - `clientMaxAge` - browser cache-control max-age directive, defaulting to 1 week
4258093 @tomgco Adding bitcoin donation
tomgco authored
26
27 Currently the gzipped version is created and stored in memory. This is not final and was done to get a working version
28 up and about. A version which will gzip text/html after res.render() / res.end() is in progress.
29
30 [node-compress](https://github.com/waveto/node-compress) gzip library is used for gzipping.
31
73181bc @tomgco Updating flattr image
tomgco authored
32 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/flattr-badge-large.png "Flattr This!")](https://flattr.com/thing/282348/gzippo-node-js-gzip-module "gzippo - node.js gzip module")
17ca150 @tomgco Updating README.md
tomgco authored
33 Bitcoin me: 1DnVpXSGubdyBSbyuJZNMNzkAVrwPJhaUL
34
4258093 @tomgco Adding bitcoin donation
tomgco authored
35 ## License
36
37 (The MIT License)
38
f7718f0 @tomgco Updating Website
tomgco authored
39 Copyright (c) 2011 Tom Gallacher &lt;<http://www.tomg.co>&gt;
4258093 @tomgco Adding bitcoin donation
tomgco authored
40
41 Permission is hereby granted, free of charge, to any person obtaining
42 a copy of this software and associated documentation files (the
43 'Software'), to deal in the Software without restriction, including
44 without limitation the rights to use, copy, modify, merge, publish,
45 distribute, sublicense, and/or sell copies of the Software, and to
46 permit persons to whom the Software is furnished to do so, subject to
47 the following conditions:
48
49 The above copyright notice and this permission notice shall be
50 included in all copies or substantial portions of the Software.
51
52 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
53 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
54 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
55 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
56 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
57 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
c50384c @jhuckabee Fix matchType references with contentTypeMatch
jhuckabee authored
58 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.