Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koajs/compressor
[DEPRECATED] Compress middleware for koa that always compresses
https://github.com/koajs/compressor
Last synced: about 1 month ago
JSON representation
[DEPRECATED] Compress middleware for koa that always compresses
- Host: GitHub
- URL: https://github.com/koajs/compressor
- Owner: koajs
- License: mit
- Archived: true
- Created: 2014-04-25T07:48:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-07T12:15:45.000Z (about 8 years ago)
- Last Synced: 2024-04-14T13:08:39.370Z (7 months ago)
- Language: JavaScript
- Homepage: https://github.com/koajs/compress
- Size: 8.79 KB
- Stars: 9
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-koa - koa-compressor - SPDY/HTTP2压缩中间件 (总是gzips) ![](https://img.shields.io/github/stars/koajs/compressor.svg?style=social&label=Star) ![](https://img.shields.io/npm/dm/koa-compressor.svg?style=flat-square) (仓库 / 中间件)
README
# Koa Compressor
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]Similar to [koa-compress][koa-compress],
except it basically __always__ compresses the response to `gzip`.
This is particularly nice for SPDY as the specifications states that user agents must [always support gzip compression](http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3#TOC-3.2-HTTP-Request-Response).
Thus, this compression middleware is a little simpler.Differences:
- `Accept-Encoding` is ignored
- No `vary` header is set
- No `this.compress` option
- Sets `content-length` on compressed bodies if available (should probably port that to [koa-compress][koa-compress])[koa-compress]: https://github.com/koajs/compress
[npm-image]: https://img.shields.io/npm/v/koa-compressor.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-compressor
[github-tag]: http://img.shields.io/github/tag/koajs/compressor.svg?style=flat-square
[github-url]: https://github.com/koajs/compressor/tags
[travis-image]: https://img.shields.io/travis/koajs/compressor.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/compressor
[coveralls-image]: https://img.shields.io/coveralls/koajs/compressor.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/koajs/compressor?branch=master
[david-image]: http://img.shields.io/david/koajs/compressor.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/compressor
[license-image]: http://img.shields.io/npm/l/koa-compressor.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/koa-compressor.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/koa-compressor
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
[gittip-url]: https://www.gittip.com/jonathanong/