Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTTP compression for downloads #2269

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

Mynacol
Copy link
Contributor

@Mynacol Mynacol commented Jun 21, 2023

Summary

As long as we use Feed-io < 6, we always use Guzzle (with Feed-io 6, we need to choose a HTTPlug library ourselves). Guzzle supports transparently decompressing gzip or deflate compressed responses, which is enabled by default.

Feed-io does this by default, but as we override the headers, we have to add a fitting Accept-Encoding header as well.

Previously, my feed collection caused up to 45.9 MB download traffic per cronjob, with this commit it is as low as 23.6 MB.

Checklist

As long as we use Feed-io < 6, we always use Guzzle (with Feed-io 6, we
need to choose a [HTTPlug](https://httplug.io/) library ourselves). Guzzle
[supports](https://docs.guzzlephp.org/en/stable/request-options.html#decode-content)
transparently decompressing gzip or deflate compressed responses, which is enabled by default.

Feed-io does this [by default](alexdebril/feed-io@ffef9ea),
but as we override the headers, we have to add a fitting `Accept-Encoding` header as well.

Previously, my feed collection caused up to 45.9 MB download traffic per cronjob,
with this commit it is as low as 23.6 MB.

Signed-off-by: Mynacol <[email protected]>
@Mynacol Mynacol force-pushed the support-compression branch from 2199150 to 6636ac9 Compare June 21, 2023 14:56
@Grotax
Copy link
Member

Grotax commented Jun 22, 2023

cool, thanks :)

@Grotax Grotax merged commit 48e1ad1 into nextcloud:master Jun 22, 2023
Grotax added a commit that referenced this pull request Jul 23, 2023
Changed
- Support deflate and gzip compression for HTTP response bodies (#2269)
- Broke apart old FAQ into different guides. Deprecated old FAQ (#2285)

Signed-off-by: Benjamin Brahmer <[email protected]>
@Grotax Grotax mentioned this pull request Jul 23, 2023
Grotax added a commit that referenced this pull request Jul 23, 2023
Changed
- Support deflate and gzip compression for HTTP response bodies (#2269)
- Broke apart old FAQ into different guides. Deprecated old FAQ (#2285)

Signed-off-by: Benjamin Brahmer <[email protected]>
Grotax added a commit that referenced this pull request Jul 23, 2023
Changed
- Support deflate and gzip compression for HTTP response bodies (#2269)
- Broke apart old FAQ into different guides. Deprecated old FAQ (#2285)

Signed-off-by: Benjamin Brahmer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants