API gateway, S3 integration and compression

0

Hello,

has anyone been able to figure out gzip-compression with API Gateway and S3 integration? If I have a uncompressed binary file in S3 and enable compression in API Gateway then requesting with "accept-encoding: gzip" works and returns proper gzip data (as long as payload is under 10MB).

What doesn't seem to work is that when file in S3 is already gzipped and has content-encoding metadata defined. API gateway re-compresses the data. So I will then receive twice gzipped data, which then breaks on all http clients.

This document here says that API gateway should not re-compress the data when integration returns content-encoding header. If the content-encoding metadata for the file has been defined, S3 will actually return that header. So is this a bug in API gateway? It seems to ignore the header and re-compresses already compressed data.

Anyone has figured out how to get this to work?

  • And if I disable the compression in API gateway, then API gateway won't do any gzipping but it will also omit the "content-encoding" header, although S3 returns it (as it has been added as metadata for the file)

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions