From b5e2d58f5e0a32e773e6b6b94624c8e3863179b5 Mon Sep 17 00:00:00 2001 From: zuisong Date: Sun, 14 Jan 2024 22:55:24 +0800 Subject: Add option for compress response --- src/args.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/args.rs') 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, -- cgit v1.2.3