Lambda Functions - Response Size Too Large

Hi,

I have a serverless lambda function that is querying the Dropbox API and returning some file data. The function returns a successful response when run from localhost, but gives me the following error from a netlify deployed link:

{"errorMessage":"Response payload size (19040285 bytes) exceeded maximum allowed payload size (6291556 bytes).","errorType":"Function.ResponseSizeTooLarge"}

My response payload contains an array of file results, and each result contains an array buffer.

Based on this information, is there a better way to return file data from a lambda function, so that the response size isn’t so large. Or do I need to look at upgrading my plan (currently I am on Pro Team)?

Thank you in advance for reviewing this issue, and let me know if you need additional info

Hiya @dmjoyce92 and welcome to our community!

I think you’ll need to keep your response under 6MByte. Even that will be a challenge - AWS has to FINISH sending it, after running your function, within the 10 seconds we let lambda’s run for. You’re already making some pretty strong suppositions about your visitors’ network connection if you think we can do all that in 10 seconds reliably.

The higher account levels do not change that limit in any way.