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)

preguntada hace un año125 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas