Skip to content

Commit

Permalink
compression: moved around
Browse files Browse the repository at this point in the history
- moved it from "downloads" to "transfer control"
- made that section generic about compression and link to the HTTP one
- create a new HTTP compression page under custom HTTP

Closes #486
  • Loading branch information
bagder committed Jun 18, 2024
1 parent e34ff44 commit bc0d8ad
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
3 changes: 2 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
* [Download to a file named by the URL](usingcurl/downloads/url-named.md)
* [Use the target filename from the server](usingcurl/downloads/content-disp.md)
* [HTML and charsets](usingcurl/downloads/charsets.md)
* [Compression](usingcurl/downloads/compression.md)
* [Shell redirects](usingcurl/downloads/redirects.md)
* [Multiple downloads](usingcurl/downloads/multiple.md)
* [My browser shows something else](usingcurl/downloads/browsers.md)
Expand All @@ -101,6 +100,7 @@
* [Stop slow transfers](usingcurl/transfers/tooslow.md)
* [Rate limiting](usingcurl/transfers/rate-limiting.md)
* [Request rate limiting](usingcurl/transfers/request-rate.md)
* [Compression](usingcurl/transfers/compression.md)
* [Connections](usingcurl/connections/README.md)
* [Name resolve tricks](usingcurl/connections/name.md)
* [Connection timeout](usingcurl/connections/timeout.md)
Expand Down Expand Up @@ -173,6 +173,7 @@
* [User-agent](http/modify/user-agent.md)
* [Ranges](http/modify/ranges.md)
* [Conditionals](http/modify/conditionals.md)
* [Compression](http/modify/compression.md)
* [HTTP PUT](http/put.md)
* [Cookies](http/cookies/README.md)
* [Cookie engine](http/cookies/engine.md)
Expand Down
1 change: 1 addition & 0 deletions http/modify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ this chapter details how you can customize those.
* [User-agent](user-agent.md)
* [Ranges](ranges.md)
* [Conditionals](conditionals.md)
* [Compression](compression.md)

Of course, changing the [HTTP version](../versions/) is another way to alter
the request.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Compression

curl allows you to ask HTTP and HTTPS servers to provide compressed versions
of the data and then perform automatic decompression of it on arrival. In
curl supports asking HTTP and HTTPS servers to provide compressed versions of
the data and then perform automatic decompression of it on arrival. In
situations where bandwidth is more limited than CPU this helps you receive
more data in a shorter amount of time.

Expand Down Expand Up @@ -41,7 +41,10 @@ hands are always compressed and cannot be sent uncompressed. However, as a
convenience to users, curl always shows the headers uncompressed in a style
similar to how they look for HTTP/1.x to make the output and look consistent.

## Uploads
## HTTP uploads

For HTTP there is no standard way to do compression. The above mentioned HTTP
compression methods only work for downloads.
For HTTP uploads with POST or PUT there is no standard way to do compression.
The above mentioned HTTP compression methods only work for downloads.

You can of course still compress the data locally before sending it to the
server.
1 change: 0 additions & 1 deletion usingcurl/downloads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ specific data pointed to by a URL onto your machine.
* [Download to a file named by the URL](url-named.md)
* [Use the target filename from the server](content-disp.md)
* [HTML and charsets](charsets.md)
* [Compression](compression.md)
* [Shell redirects](redirects.md)
* [Multiple downloads](multiple.md)
* [My browser shows something else](browsers.md)
Expand Down
1 change: 1 addition & 0 deletions usingcurl/transfers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ multiple transfers.
* [Stop slow transfers](tooslow.md)
* [Rate limiting](rate-limiting.md)
* [Request rate limiting](request-rate.md)
* [Compression](compression.md)
19 changes: 19 additions & 0 deletions usingcurl/transfers/compression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Compression

Automatic compression of data before it gets sent can help getting the data to
the other end faster due to the reduced bandwidth needed.

curl offers automatic compression and decompression for SFTP, SCP and HTTP(S).
With HTTP(S) it is only possible to do it for downloads, while SFTP and SCP
offer it for both directions.

## For HTTP

See [HTTP compression](../../http/modify/compression.md) for the details.

## For SFTP/SCP

Provide the `--compressed-ssh` option on the command line and the transfer
will automatically and transparently use compression if it can. Like:

curl -O --compressed-ssh sftp://example.com/bigfile

0 comments on commit bc0d8ad

Please sign in to comment.