aboutsummaryrefslogtreecommitdiffstats
path: root/src/args.rs
diff options
context:
space:
mode:
authorzuisong <com.me@foxmail.com>2024-01-14 14:55:24 +0000
committerzuisong <com.me@foxmail.com>2024-01-16 13:02:29 +0000
commitb5e2d58f5e0a32e773e6b6b94624c8e3863179b5 (patch)
tree491e9891bb31a49a2954de819b4620f03ce57740 /src/args.rs
parentCompress response using `actix_web::middleware::compress` (diff)
downloadminiserve-b5e2d58f5e0a32e773e6b6b94624c8e3863179b5.tar.gz
miniserve-b5e2d58f5e0a32e773e6b6b94624c8e3863179b5.zip
Add option for compress response
Diffstat (limited to '')
-rw-r--r--src/args.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index cc8b0f1..25f2915 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -214,6 +214,18 @@ pub struct CliArgs {
#[arg(short = 'z', long = "enable-zip", env = "MINISERVE_ENABLE_ZIP")]
pub enable_zip: bool,
+ /// Enable compress response
+ ///
+ /// WARNING: Enabling this option may slow down transfers due to CPU overhead, so it is disabled by default.
+ ///
+ /// Only enable this option if you know that your users have slow connections or if you want to minimize your server's bandwidth usage.
+ #[arg(
+ short = 'C',
+ long = "compress-response",
+ env = "MINISERVE_COMPRESS_RESPONSE"
+ )]
+ pub compress_response: bool,
+
/// List directories first
#[arg(short = 'D', long = "dirs-first", env = "MINISERVE_DIRS_FIRST")]
pub dirs_first: bool,