Closed mbklein closed 11 months ago
@mbklein - We have implemented the streaming response by creating a Readable stream from the result of resource.execute()
e.g.
const result = await resource.execute();
streamResponse.setContentType(result.contentType);
const r = Readable.from(result.body);
await pipeline(r, streamResponse);
We have confirmed it works as expected. Would you be interested in a pull request with the entire implementation?
Sure!
@mbklein - quick update
The PR was written on GFE, so therefore I need some approvals and I am working internally to retain the necessary approvals.
AWS Lambda now supports streaming-enabled functions, with a soft response payload size limit of 20MB, instead of the hard 6MB limit on buffered responses. This might be an opportunity to simplify our deployment by getting rid of the need for the cache bucket/CloudFront failover origin workaround for large responses.