Swiftpack.co - hummingbird-project/hummingbird-compression as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by hummingbird-project.
hummingbird-project/hummingbird-compression 1.0.0-alpha.2
Compression support for Hummingbird server framework
⭐️ 3
🕓 Yesterday
iOS tvOS
.package(url: "https://github.com/hummingbird-project/hummingbird-compression.git", from: "1.0.0-alpha.2")

Hummingbird Compression

Adds request decompression and response compression to Hummingbird

Usage

let app = HBApplication()
// run response compression on application thread pool when buffer is 
// larger than 32768 bytes otherwise run it on the eventloop
app.addResponseCompression(execute: .onThreadPool(threshold: 32768))
// run request decompression on eventloop with no limit to the size
// of data that can be decompressed
app.addRequestDecompression(execute: .onEventLoop, limit: .none)

Adding request decompression means when a request comes in with header content-encoding set to gzip or deflate the server will attempt to decompress the request body. Adding response compression means when a request comes in with header accept-encoding set to gzip or deflate the server will compression the response body.

GitHub

link
Stars: 3
Last commit: 2 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v1.0.0 Alpha 2
2 days ago

Minor release changes

  • Requires Swift 5.5 (inline with SwiftNIO)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics