0

I was looking at setting up an S3 origin with pre-compressed objects. This mostly work by setting the content-encoding on the object and CloudFront will forward the compressed object or even convert it from gzip to br.

However it appears to have a problem when the client doesn't support compression. In this case CloudFront will just return the compressed object anyways leading to effectively corruption.

Is there a way to make CloudFront decompress these objects for viewers that don't request/support compression? For example like the nginx ngx_http_gunzip_module?

Kevin Cox
  • 3,080
  • 1
  • 32
  • 32
  • Does the pre-compressed object stored in S3 have the proper `content-encoding` header set? – jellycsc Nov 03 '22 at 14:48
  • It does, but that doesn't help if the client doesn't support that content-encoding. For example `curl example/index.html` will return the gziped version of `index.html`. You need to do `curl --compressed` so that curl decompresses it. – Kevin Cox Nov 03 '22 at 18:10
  • 1
    CloudFront does not decompress the objects in any time. – jellycsc Nov 03 '22 at 18:35

0 Answers0