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)

已提問 1 年前檢視次數 125 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南