Transmitting data in compressed format
To save bandwidth, you can compress object data, an annotation, or an ACL in GZIP format before sending it to HCP. In the PUT request, you tell HCP that data is compressed so that HCP knows to decompress the data before storing it.
Similarly, in a GET request, you can tell HCP to return object data, an annotation, or an ACL in compressed format. In this case, you need to decompress the returned data yourself.
HCP supports only the GZIP algorithm for compressed data transmission.
You tell HCP that the request body is compressed by including a Content-Encoding
header with the value gzip
in the HTTP PUT request. In this case, HCP uses the GZIP algorithm to decompress the received data.
You tell HCP to send a compressed response by specifying an Accept-Encoding
header in the HTTP GET request. If the header specifies gzip
, a list of compression algorithms that includes gzip
, or *
, HCP uses the GZIP algorithm to compress the data before sending it.
Content-Encoding
header. To retrieve stored GZIP-compressed data, do not use an Accept-Encoding
header.