Cloudflare Worker - Double Compression

Hi All,

We are currently looking into replacing AWS API Gateway with a custom “lambda-proxy” service running on a Cloudflare Worker. However the compressed response received from the intended lambda function seems to be getting re-compressed (gzip) again automatically by Cloudflare.

We have tried setting the “Origin Cache Control -> On using a Page Rule” and cache-control: no-transform at the lambda origin but the double compressions still persists.

We are currently invoking the function using-the fetch interface and have worked around the issue by decompressing the response from Lambda once before returning it back to the request originator, which is far from ideal.

Would any one know of a way to disable/work around this auto compression on the CF worker itself?

Thanks :slight_smile:

1 Like

I have the same issue and haven’t found the way to disable auto decompress and then recompress Cloudflare logic in any way unfortunately

1 Like

Also suffering from this. We’re returning a response that contains content-encoding: "gzip" so it’d be good if CF didn’t re-compress when that header is present.

Related? Method to decode gzip or flag to prevent double-compression (lambda)