• Stars
    star
    213
  • Rank 184,336 (Top 4 %)
  • Language
    JavaScript
  • Created over 13 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

gzippo pronounced `g-zippo` is a nodejs gzip middleware for Connect and express js using the new native node zlib api

Deprecated Please use https://github.com/expressjs/compression instead

gzippo Build Status

gzippo pronounced g-zippo is a gzip middleware for Connect / expressjs using node-compress for better performance, in node 0.6 and up will be using the new zlib api.

gzippo currently only supports only gzipping static content files however a release is in progress to introduce streaming support.

Notice

Please note that [email protected] branch will only be tested for nodejs 0.4, where as [email protected] will work for node 0.6

Installation

$ npm install gzippo

Usage

Static Gzip

In your express/connect server setup, use as follows:

var gzippo = require('gzippo');

//Replace the static provider with gzippo's
//app.use(express.static(__dirname + '/public'));
app.use(gzippo.staticGzip(__dirname + '/public'));

Options:

  • 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/.
  • maxAge - cache-control max-age directive, defaulting to 1 day
  • clientMaxAge - browser cache-control max-age directive, defaulting to 1 week
  • prefix - A url prefix. If you want all your static content in a root path such as /resource/. Any url paths not matching will be ignored

Currently the gzipped version is created and stored in memory. This is not final and was done to get a working version up and about.

Gzippo now uses the native Zlib support found in node >= 0.6

Streaming Gzip

Starting in Connect 2.X Expressjs has the ability to use a streaming gzip module provided natively by connect. As this 2.X branch is not currently stable I have back ported the compress.js component into gzippo.

app.use(gzippo.staticGzip(__dirname + '/public'));
app.use(gzippo.compress());

This has no caching and is currently unsupported as it will be included in a future connect 1.X release, up until then compress.js will be included in gzippo.

License

(The MIT License)

Copyright (c) 2011 Tom Gallacher <http://www.tomg.co>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

gyro.js

gyro.js - easy access to your web browsers built in accelerometer and gyroscope
JavaScript
377
star
2

dis.io

A browser based distributed computing platform utilising idle cpu cycles on visitors computers when browsing
JavaScript
26
star
3

cpu-profiler

Node bindings for the v8 cpu profiler
C++
23
star
4

chrome-cpu-profiler

View Top down, Bottom up and flamecharts of your node app in Google Chrome
JavaScript
22
star
5

indy

Continuously poll node.js/io.js and time the eventloop delay, process info, memory info, etc.
JavaScript
22
star
6

node-zbar

JavaScript
14
star
7

Arduino_Helicopter

A Syma 107 Helicopter controlled by a Arduino.
Java
11
star
8

node-dropbox-sdk

[Not Maintained] An alternative dropbox api for nodejs
JavaScript
9
star
9

node-lp

Physically print stuff in node.js
JavaScript
8
star
10

SymaRemote

A re-write of the original helicopter software to use PWM and abstracted to a library.
C++
6
star
11

ArduinoCopterS107

A Controller for my Arduino Helicopter Project
Objective-C
6
star
12

Gamepad-Helicopter-Controller

An interface to control the Arduino Helicopter using the Gamepad
JavaScript
5
star
13

tapeshopper

Learn how to test with tape! (tap-producing test harness for node)
JavaScript
5
star
14

JugglingTracker

Track juggling balls
C++
4
star
15

robots.txt

robots.txt middleware for express/connect to server up your robots.txt
JavaScript
4
star
16

Little-Note

A really little note application
JavaScript
4
star
17

elixir-charm

ANSI rainbow for elixir, be a magician
Elixir
4
star
18

siriproxy-lag

Displays the lag status at 56 using SiriProxy
Ruby
3
star
19

cluster-dash

Golang dashboard for multiple k8s clusters.
Go
3
star
20

hello-next-performance

linux perf on next.js
JavaScript
3
star
21

node-docker-stop

Shutdown gracefully within docker containers.
JavaScript
3
star
22

PersonalSite

My personal website
JavaScript
3
star
23

tensorflow-talk

My Tensorflow London Talk - 27/10/16
Jupyter Notebook
3
star
24

darkroom

An image manipulation service.
JavaScript
2
star
25

dis.covery

JavaScript
2
star
26

gzippo-redis

A redis store for gzippo
JavaScript
2
star
27

darkroom-persistence

JavaScript
2
star
28

node-availability

A way to determine if a service is available, using various methods
JavaScript
2
star
29

node-webcrypto

An adaption of the WebCryptoAPI to conform to API's provided by Nodejs (No Promises So Forth)
JavaScript
2
star
30

ml-for-engineers

Easy Machine-Learning using ludwig 👩‍🔬🎼
Shell
2
star
31

dot-files

Shell
2
star
32

shopsense-js

A node module to interact with the ShopSense API
JavaScript
2
star
33

Android-SDK-Runner

Injects items into the emulated android device
Shell
2
star
34

Fortran97-Bailey-Borwein-Plouffe

Bailey–Borwein–Plouffe formula in fortran, be nice it's my first one!
Fortran
2
star
35

motorola-ssi

Communicate with a Motorola SE3307 IG scanner using SSI over USB in node.js
JavaScript
2
star
36

gcloud-pubsub-to-sql

Store particle.io gcloud pub/sub messages to gcloud hosted sql
JavaScript
2
star
37

object-array-merge

Merges Object Arrays based on an object key, A.K.A: Tom’s Merge
JavaScript
1
star
38

dis.io-client

Client for dis.io
JavaScript
1
star
39

elixir-menu

Menu's in elixir - this is fubar unless we can call on a keypress...
Elixir
1
star
40

Back-Row

iTunes Library Fun.
Objective-C
1
star
41

spotify-remote-server

JavaScript
1
star
42

node-cxxfilt

c++filt in JavaScript :D (well not yet)
JavaScript
1
star
43

node-switch

A CLI tool to switch to the version of nodejs defined in an applications package.json
1
star
44

cuke2jade

Cucumber.js json output to jade
JavaScript
1
star
45

lnug-streams

White water streams
HTML
1
star
46

jshint-full-path

A JSHint reporter to show a full path with colon separated row and columns
JavaScript
1
star
47

userGen

Elixir
1
star
48

dis.io-distributor

Distributor component for dis.io
JavaScript
1
star
49

dis.io-manager

Manager Component for dis.io
JavaScript
1
star
50

spotify-remote-app

CSS
1
star
51

temperature-regulated-box

An open-source hardware project to design and build a temperature controlled box.
1
star
52

xiaomi-mi-home-air-purifier

Control your Xiaomi air purifier
JavaScript
1
star
53

fastly-shadow-load-rust

Rust
1
star
54

tomgco.zsh-theme

My zsh theme, based mostly on steeef's
1
star
55

MacCalc

A Very simple, poorly written Calculator App for Mac OS X
Objective-C
1
star
56

cstate

Disable CPU c-states on Intel i7's, and maybe other intel CPU's
JavaScript
1
star
57

Gawkwall-iPhone-App

Gawkwall iPhone App
Objective-C
1
star
58

indy-statsd

A Statsd dispatcher for indy.
JavaScript
1
star