armature-compression
HTTP response compression middleware for the Armature framework.
Features
- Multiple Algorithms - gzip, brotli, zstd
- Content Negotiation - Accept-Encoding support
- Streaming - Compress as data is generated
- Configurable - Min size, compression levels
- Auto Detection - Skip already compressed content
Installation
[]
= "0.1"
Quick Start
use CompressionMiddleware;
use Application;
let app = new
.with_middleware
.get;
Configuration
let compression = new
.gzip
.brotli
.min_size // Don't compress < 1KB
.exclude_types;
Streaming Compression
use StreamingCompressor;
let compressor = gzip;
// Compress chunks as they're generated
for chunk in data_stream
License
MIT OR Apache-2.0