gzip compression with Lambda function URL?

0

Hi

Is there a way to enable gzip compression with the lambda function url, I have set the following in the actual function code but it doesnt seem to work? let response = { statusCode: 200, headers: { 'Access-Control-Allow-Headers': 'Content-Type', 'Access-Control-Allow-Origin': '*', 'Accept-Encoding': 'gzip' }, body: JSON.stringify(responseBody) };

1 個回答
0

What are you trying to do? Send compressed content to the function or receive compressed content from the function? In either case, the content is binary, so it will be base64 encoded.

If you want to return from the function to the client, you need to compress the body yourself, encode it using base64, and set the content-type appropriately.

profile pictureAWS
專家
Uri
已回答 2 年前
profile picture
專家
已審閱 22 天前

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

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

回答問題指南