Transmitting data in compressed format

Content Platform Tenant Management Help

File Size
4269 KB
Part Number

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.

Note: HCP normally compresses the object data, annotations, and ACLs that it stores, so you don’t need to explicitly compress objects for storage. However, if you do need to store GZIP-compressed objects, annotations, or ACLs, do not use a Content-Encoding header. To retrieve stored GZIP-compressed data, do not use an Accept-Encoding header.