From 5171f6b5057a92ceec46db93f11723c7f6b8857a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Thu, 5 Oct 2023 09:00:11 +0200 Subject: [PATCH] improve compress middleware documentation --- docs/api/middleware/compress.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/middleware/compress.md b/docs/api/middleware/compress.md index f284f5e92c..472f9d9804 100644 --- a/docs/api/middleware/compress.md +++ b/docs/api/middleware/compress.md @@ -6,6 +6,10 @@ id: compress Compression middleware for [Fiber](https://github.com/gofiber/fiber) that will compress the response using `gzip`, `deflate` and `brotli` compression depending on the [Accept-Encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding) header. +:::note +The compression middleware refrains from compressing bodies that are smaller than 200 bytes. This decision is based on the observation that, in such cases, the compressed size is likely to exceed the original size, making compression inefficient. [more](https://github.com/valyala/fasthttp/blob/497922a21ef4b314f393887e9c6147b8c3e3eda4/http.go#L1713-L1715) +::: + ## Signatures ```go