All Projects → deno-libs → http_compression

deno-libs / http_compression

Licence: MIT license
🗜️ Deno HTTP compression middleware

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to http compression

EasyCompressor
⚡ A compression library that implements many compression algorithms such as LZ4, Zstd, LZMA, Snappy, Brotli, GZip, and Deflate. It helps you to improve performance by reducing Memory Usage and Network Traffic for caching.
Stars: ✭ 167 (+391.18%)
Mutual labels:  compression, gzip, compress, deflate
Compression
Node.js compression middleware
Stars: ✭ 2,506 (+7270.59%)
Mutual labels:  compression, gzip, deflate
compress
compress and uncompress for Deno
Stars: ✭ 29 (-14.71%)
Mutual labels:  gzip, deflate, deno
deflate-rs
An implementation of a DEFLATE encoder in rust
Stars: ✭ 47 (+38.24%)
Mutual labels:  compression, gzip, deflate
power-gzip
POWER9 gzip engine documentation and code samples
Stars: ✭ 16 (-52.94%)
Mutual labels:  compression, gzip, deflate
pyrus-cramjam
Thin Python wrapper to de/compression algorithms in Rust - lightweight & no dependencies
Stars: ✭ 40 (+17.65%)
Mutual labels:  compression, gzip, deflate
Uzlib
Radically unbloated DEFLATE/zlib/gzip compression/decompression library. Can decompress any gzip/zlib data, and offers simplified compressor which produces gzip-compatible output, while requiring much less resources (and providing less compression ratio of course).
Stars: ✭ 168 (+394.12%)
Mutual labels:  compression, gzip
Datacompression
Swift libcompression wrapper as an extension for the Data type (GZIP, ZLIB, LZFSE, LZMA, LZ4, deflate, RFC-1950, RFC-1951, RFC-1952)
Stars: ✭ 191 (+461.76%)
Mutual labels:  compression, gzip
Turbobench
Compression Benchmark
Stars: ✭ 211 (+520.59%)
Mutual labels:  compression, gzip
em inflate
Fast, small, in-memory inflate (zlib, deflate and gzip decompression)
Stars: ✭ 59 (+73.53%)
Mutual labels:  compression, gzip
ZipArchive
A single-class pure VB6 library for zip with ASM speed
Stars: ✭ 38 (+11.76%)
Mutual labels:  compression, compress
restio
HTTP Client for Dart inspired by OkHttp
Stars: ✭ 46 (+35.29%)
Mutual labels:  gzip, deflate
Bit7z
A C++ static library offering a clean and simple interface to the 7-zip DLLs.
Stars: ✭ 159 (+367.65%)
Mutual labels:  compression, gzip
Tinydeflate
A deflate/gzip decompressor that requires minimal amount of memory to work
Stars: ✭ 148 (+335.29%)
Mutual labels:  compression, gzip
Gtz
A high performance and compression ratio compressor for genomic data, powered by GTXLab of Genetalks.
Stars: ✭ 137 (+302.94%)
Mutual labels:  compression, compress
Gzip
💾 Golang gzip middleware for Gin and net/http | Golang gzip中间件,支持Gin和net/http,开箱即用同时可定制
Stars: ✭ 113 (+232.35%)
Mutual labels:  compression, gzip
zzlib
zlib-compressed file depacking library in Lua
Stars: ✭ 44 (+29.41%)
Mutual labels:  gzip, deflate
bundle
An online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.
Stars: ✭ 475 (+1297.06%)
Mutual labels:  gzip, deno
hasmin
Hasmin - A Haskell CSS Minifier
Stars: ✭ 55 (+61.76%)
Mutual labels:  compression, gzip
Fastify Compress
Fastify compression utils
Stars: ✭ 95 (+179.41%)
Mutual labels:  compression, gzip

http_compression

nest badge GitHub Workflow Status Codecov

Deno HTTP compression middleware.

Features

  • gzip, deflate and brotli support
  • Detects supported encodings with Accept-Encoding header
  • Respects encodings order (depending on Accept-Encoding value)
  • Creates a Content-Encoding header with applied compression
  • Send 409 Not Acceptable if encoding is not supported

Example

import { compression } from 'https://deno.land/x/http_compression/mod.ts'
import { Server } from 'https://deno.land/http/server.ts'

const s = new Server({
  handler: async (req) => {
    return await compression({
      path: 'README.md',
      compression: ['br', 'gzip', 'deflate']
    })(req)
  },
  addr: ':3000'
})

s.listenAndServe()

Now try to send a HEAD request with curl:

$ curl localhost:3000 --head -H "Accept-Encoding: br, gzip, deflate" --compressed
HTTP/1.1 200 OK
content-length: 550
content-encoding: br, gzip, deflate
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].