From 8ae706293149fb6e3d40af3ac80a8661fa379111 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Fri, 4 Aug 2023 12:39:39 -0600 Subject: [PATCH] fix(ext/http): serveHttp brotli compression level should be fastest (#20058) Use brotli's fastest mode rather than default mode --- ext/http/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 21c051cae6..8060b5a1e8 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -743,7 +743,9 @@ fn http_response( let (reader, _) = tokio::io::split(a); let (_, writer) = tokio::io::split(b); let writer: Pin> = match encoding { - Encoding::Brotli => Box::pin(BrotliEncoder::new(writer)), + Encoding::Brotli => { + Box::pin(BrotliEncoder::with_quality(writer, Level::Fastest)) + } Encoding::Gzip => Box::pin(GzipEncoder::with_quality( writer, Level::Precise(GZIP_DEFAULT_COMPRESSION_LEVEL.into()),