Skip to content

feat: enable brotli request compression by default#1052

Open
vdusek wants to merge 4 commits into
masterfrom
feat/enable-brotli-compression
Open

feat: enable brotli request compression by default#1052
vdusek wants to merge 4 commits into
masterfrom
feat/enable-brotli-compression

Conversation

@vdusek

@vdusek vdusek commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Enables brotli compression as the default for all SDK/client ↔ platform communication.

apify-client v3 defaults to gzip, so enabling brotli takes two parts:

  • Dependency: pull in the apify-client[brotli] extra so the brotli backend is installed. apify-client v3.1 (which adds request body compression) isn't released yet, so this temporarily pins the latest beta that already ships the extra (apify-client[brotli]>=3.0.7b1). A TODO in pyproject.toml tracks switching to >=3.1.0 once v3.1 is out.
  • Code: both places where the SDK constructs an ApifyClientAsync (Actor.new_client and the storage-client factory _create_api_client) now pass compression='brotli'. Since the SDK hard-depends on apify-client[brotli], the brotli backend is always installed, so brotli is passed directly.

Tests: a wire-level test drives a real request through an SDK-created client against a local HTTP server and asserts the body goes out with Content-Encoding: br and round-trips back through brotli.decompress. It's parametrized over both client-creation paths (_create_api_client and Actor.new_client).

Closes #1045

@vdusek vdusek self-assigned this Jul 16, 2026
@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Jul 16, 2026
@github-actions github-actions Bot added this to the 145th sprint - Tooling team milestone Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (573e3a3) to head (33271d5).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1052      +/-   ##
==========================================
+ Coverage   91.77%   91.87%   +0.10%     
==========================================
  Files          50       50              
  Lines        3222     3225       +3     
==========================================
+ Hits         2957     2963       +6     
+ Misses        265      262       -3     
Flag Coverage Δ
e2e 35.56% <ø> (-0.01%) ⬇️
integration 57.33% <ø> (-0.03%) ⬇️
unit 83.22% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jul 16, 2026
@vdusek vdusek marked this pull request as ready for review July 16, 2026 11:34
@vdusek vdusek requested a review from Pijukatel July 16, 2026 11:34
@vdusek vdusek changed the title feat: enable brotli request compression by default via apify-client[brotli] feat: enable brotli request compression by default Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt apify-client v3.1 and enable brotli compression by default

2 participants