You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quality 6 is a reasonable default (better ratio than gzip, much lower CPU than brotli's max quality 11), and it's documented as such in docs/02_concepts/13_compression.mdx. But it's not tunable: users who want maximum compression (quality 11) for bandwidth-bound workloads, or a lower quality to save CPU, currently have no way to change it.
Proposal
Expose the compression quality as a client-level configuration option instead of relying only on the hardcoded value. Points to decide during design:
A client parameter (e.g. on ApifyClient / the HTTP client) to override the brotli quality, defaulting to the current 6.
Whether to also make the gzip compression level configurable for symmetry.
Whether to let users force a specific algorithm rather than relying purely on import-based auto-detection (br when brotli is importable, gzip otherwise) — the current behavior flips to brotli whenever the brotli package is present in the environment, even if it was pulled in transitively.
PR #927 added optional brotli request-body compression. The brotli quality is currently hardcoded to 6 in
src/apify_client/http_clients/_base.py:Quality 6 is a reasonable default (better ratio than gzip, much lower CPU than brotli's max quality 11), and it's documented as such in
docs/02_concepts/13_compression.mdx. But it's not tunable: users who want maximum compression (quality 11) for bandwidth-bound workloads, or a lower quality to save CPU, currently have no way to change it.Proposal
Expose the compression quality as a client-level configuration option instead of relying only on the hardcoded value. Points to decide during design:
ApifyClient/ the HTTP client) to override the brotli quality, defaulting to the current6.brwhenbrotliis importable,gzipotherwise) — the current behavior flips to brotli whenever thebrotlipackage is present in the environment, even if it was pulled in transitively.Context