{"id":13800008,"url":"https://github.com/koajs/compressor","last_synced_at":"2025-10-08T02:31:48.034Z","repository":{"id":16387694,"uuid":"19138364","full_name":"koajs/compressor","owner":"koajs","description":"[DEPRECATED] Compress middleware for koa that always compresses","archived":true,"fork":false,"pushed_at":"2016-10-07T12:15:45.000Z","size":9,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-30T00:55:22.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/koajs/compress","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koajs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-25T07:48:30.000Z","updated_at":"2024-07-21T00:29:38.000Z","dependencies_parsed_at":"2022-07-25T04:32:24.505Z","dependency_job_id":null,"html_url":"https://github.com/koajs/compressor","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fcompressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fcompressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fcompressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fcompressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koajs","download_url":"https://codeload.github.com/koajs/compressor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235349368,"owners_count":18975802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:08.206Z","updated_at":"2025-10-08T02:31:42.720Z","avatar_url":"https://github.com/koajs.png","language":"JavaScript","readme":"\n# Koa Compressor\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n[![Gittip][gittip-image]][gittip-url]\n\nSimilar to [koa-compress][koa-compress],\nexcept it basically __always__ compresses the response to `gzip`.\nThis 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).\nThus, this compression middleware is a little simpler.\n\nDifferences:\n\n- `Accept-Encoding` is ignored\n- No `vary` header is set\n- No `this.compress` option\n- Sets `content-length` on compressed bodies if available (should probably port that to [koa-compress][koa-compress])\n\n[koa-compress]: https://github.com/koajs/compress\n[npm-image]: https://img.shields.io/npm/v/koa-compressor.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-compressor\n[github-tag]: http://img.shields.io/github/tag/koajs/compressor.svg?style=flat-square\n[github-url]: https://github.com/koajs/compressor/tags\n[travis-image]: https://img.shields.io/travis/koajs/compressor.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koajs/compressor\n[coveralls-image]: https://img.shields.io/coveralls/koajs/compressor.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/koajs/compressor?branch=master\n[david-image]: http://img.shields.io/david/koajs/compressor.svg?style=flat-square\n[david-url]: https://david-dm.org/koajs/compressor\n[license-image]: http://img.shields.io/npm/l/koa-compressor.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/koa-compressor.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/koa-compressor\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n","funding_links":[],"categories":["仓库"],"sub_categories":["中间件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoajs%2Fcompressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoajs%2Fcompressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoajs%2Fcompressor/lists"}