ppkarwasz commented on PR #777: URL: https://github.com/apache/commons-compress/pull/777#issuecomment-4863192879
> My initial reaction to the ratio check feature is that it's nice but I doubt folks will know how to use it properly without shooting themselves in the foot. "Our app blew up when we allowed users to import files of type foo but everything was fine with bar files" kind of thing. As with most features, we probably need to provide sensible defaults, so users don't need to modify them. AI gives the following usual compression rates: - Binaries: 2-3× - Text/source code: 3-5× - XML/JSON: 5-15× - Log files: 10-30× Higher compression rates are impossible, unless you compress zeros, so 100× looks like a safe default. When I chose the default ratio for apache/mina#52, I tried to copy what HTTP Server does: [`mod_deflate`](https://httpd.apache.org/docs/current/mod/mod_deflate.html), has these knobs: - `DeflateInflateRatioLimit` defaults to 200, - Rather than a grace size, `mod_deflate` only rejects a stream once the cumulative ratio stays above the limit for `DeflateInflateRatioBurst + 1` (default `4`) consecutive output buffers. With the default 8 KiB buffer, that corresponds to roughly 32 KiB of decompressed output. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
