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.
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)
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)