#tide #middleware #brotli #gzip #compression

tide-compress

Outgoing compression middleware for the Tide server framework

8 releases (breaking)

new 0.7.0 Oct 17, 2020
0.6.0 Sep 28, 2020
0.5.0 Aug 1, 2020
0.4.0 Jul 19, 2020
0.1.1 May 23, 2020

#83 in HTTP server

Download history 4/week @ 2020-06-28 5/week @ 2020-07-05 8/week @ 2020-07-12 23/week @ 2020-07-19 7/week @ 2020-07-26 37/week @ 2020-08-02 36/week @ 2020-08-09 10/week @ 2020-08-16 3/week @ 2020-08-23 40/week @ 2020-08-30 58/week @ 2020-09-06 62/week @ 2020-09-13 93/week @ 2020-09-20 117/week @ 2020-09-27 45/week @ 2020-10-04 28/week @ 2020-10-11

183 downloads per month

BlueOak-1.0.0

9KB
101 lines

tide-compress

Outgoing compression middleware for the Tide server framework.

#[async_std::main]
async fn main() -> tide::Result {
    let mut app = tide::new();
    app.with(tide_compress::CompressMiddleware::new());
}

Features

  • Support for Brotli, Gzip, and Deflate encodings, compile-time configurable through cargo feature flags.
    • Prioritizes Brotli if available.
    • Only pulls in the necessary dependencies for the desired configuration.
    • Defaults to Brotli + Gzip.
  • Accept-Encoding checking including priority.
  • Minimum body size threshold.
    • Configurable when created by CompressMiddleware::with_threshold(usize).
  • Does not compress responses with a Cache-Control: no-transform header.
  • Sets the Vary header.

Caveats

  • Does not do any Content-Type / MIME checking.

License

Licensed under the BlueOak Model License 1.0.0Contributions via DCO 1.1

Dependencies

~7–10MB
~213K SLoC