One of the benefits of Amazon API Gateway is the ability for clients to call your API with compressed payloads using supported compression types. While API Gateway supports decompression of the request payload, it is important to configure your API to enable compression of the response payload. Enabling content encoding (compression) for your API payload can improve API performance and reduce bandwidth utilization. To ensure efficient compression of API payloads, enable the Content Encoding feature for your Amazon API Gateway APIs. Once this feature is enabled, API Gateway allows compression of response bodies based on the client's Accept-Encoding header. Compression is triggered when the response body size is equal to or greater than the minimum compression size threshold, which can be set to a non-negative integer between 0 and 10485760 (10M bytes). Amazon API Gateway supports compression types such as GZIP, DEFLATE, and IDENTITY.
To remediate the issue of not having the Content Encoding feature enabled for your Amazon API Gateway APIs, follow these steps:
By following these steps, you can enable the Content Encoding feature for your Amazon API Gateway APIs, which allows for efficient compression of response payloads. This can help improve your API performance and reduce bandwidth utilization.