When using services created by other people, it’s often neither obvious what they mean, let alone . One of these error messages you might see when using Amazon API Gateway is “ ”. how to fix them encoding not enabled The first question here is, ? The first thought might go into the video or audio encoding direction and lead to a dead-end since you probably didn’t send any audio or video files. The error message is confusing because it . what kind of encoding does this error message refer to aims to compress your response payload What does “API Gateway Encoding not Enabled” mean? Content-encoding will be when you create a new API. So it’s very likely that you already have one or multiple APIs running that don’t use this feature. disabled by default Depending on your API responses’ size, . And outbound traffic from AWS can get expensive quickly. disabled content-encoding can lead to needlessly high traffic How do you enable API Gateway content-encoding? If you’re using the API Gateway console, you can . simply enable content-encoding in your API settings Be aware that there are two “Settings” menu-items. First, you need to , and then you and not the general settings of the API Gateway service at the bottom. select your API select the settings of that API Below, you can see the highlighted “Settings” menu-item for a gateway called “Endpoint.” API Gateway settings If you’re using the , the following command will update your API. AWS CLI $ aws apigateway update-rest-api \ –rest-api-id <YOUR_API_ID> \ –patch-operations op=replace,path=/minimumCompressionSize,value=0 Replace <YOUR_API_ID> with the ID of the API you want to enable content-encoding for. If you choose a higher value than 0 for compression, all responses below that value . won’t be compressed With CloudFormation, you have to set the MinimumCompressionSize property of your AWS::ApiGateway::RestApi resource. Why should you disable content-encoding? In most cases, content-encoding . Compression algorithms are optimized these days, and . doesn’t pose any problems almost all HTTP clients can work with compressed response payloads One reason to keep it disabled is . Compressing your responses doesn’t come for free. Minimal responses or binary responses often , so you’re better off sending them uncompressed and save latency by removing a compression step. performance don’t compress very well Another reason is . If you need to scan some network frames with a tool like WireShark for some reason, . debugging disabling content-encoding would give you more insights The final reason is the support of . If you work in a slow-moving company, the chances are that you have some ancient versions of the Internet Explorer floating around. This can lead to problems with compressed responses, especially when their . legacy browsers content is an already zipped file Summary Content-encoding is about the compression of your API responses, and you should consider enabling it to . save money on outgoing AWS traffic If you have specific needs, like sending hard to compress binaries or only minimal response payloads, you can . opt-out to squeeze out the last few milliseconds of latency You can also check if the content-encoding feature is enabled for API Gateway stages to compress API payloads with Dashbird. The Well-Architected Insights feature will give you a quick and easy understanding of how your current settings are impacting your whole system, what exactly is affected, and what to do about it: Dashbird’s Well-Architected checks against API Gateway encoding Previously published at https://dashbird.io/blog/api-gateway-encoding-not-enabled/