vetis-encode adds diffent compression methods to your host, choose the most appropriate one for your usecase!
- basic
Add this to your Cargo.toml:
[dependencies]
vetis-encode = { version = "0.1.0", features = "gzip" }Below you can find instruction on how to configure many auth options availble on vetis.
use vetis_encode::HookConfig as EncodeHookConfig;
let config = EncodeHookConfig::builder()
.build()?;- name: "encode"
matcher:
type: "path"
paths:
- "/protected*"
formats:
- format: "gzip"
level: "best"
minimum_size: 1024- matcher: If set, this hook will be only called if request meet the criteria defined by him, otherwise, all requests will call this hook (optional)
- formats: Allow provide a list of encoding formats and their compression levels, currently gzip, brotli, deflated and zstd are supported
- minimum_size: A minimum content size to be compressed, specified in bytes
Choose the appropriate runtime feature for your project:
runtime-tokio(default): Use with Tokio runtimegzip: Enable gzip compression supportbrotli: Enable brotli compression supportdeflate: Enable deflate compression supportzstd: Enable zstd compression support
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Rogerio Pereira Araujo [email protected]