AWS Lambda Adds Response Streaming for .NET Functions
AWS Lambda now supports response streaming for .NET functions, allowing applications to send data incrementally as it's generated rather than buffering the entire response. This significantly improves responsiveness for LLM/AI token generation, large data exports, and larger responses, increasing the maximum response size to 200 MB. The feature is available for .NET 8 and later and integrates with Amazon API Gateway and ASP.NET Core applications.
- →Response Streaming for .NET Lambda Functions
- →Streaming LLM/AI Responses
- →API Gateway Integration with Response Streaming
- →ASP.NET Core Integration with Response Streaming
- →Increased Response Size Limit
Features (4) ›
- Response Streaming for .NET Lambda Functions
AWS Lambda now supports response streaming for .NET functions, enabling incremental data transfer to the caller as it becomes available. This avoids buffering the entire response in memory, enhancing responsiveness for workloads that produce large outputs or generate data over time. The feature is available for .NET 8 and later.
- Streaming LLM/AI Responses
The response streaming capability is particularly useful for AI workloads, allowing functions to stream tokens from models as they are generated, making conversational AI experiences more responsive. This can be achieved using frameworks like Microsoft.Extensions.AI with the AWSSDK.Extensions.Bedrock.MEAI provider.
- API Gateway Integration with Response Streaming
Lambda response streaming can be used with API Gateway REST APIs. A prelude containing the HTTP status code and headers must be included, created using `LambdaResponseStreamFactory.CreateHttpStream`. The API Gateway integration requires configuration for streaming, specifically setting the integration URI to use the `/response-streaming-invocations` path and `responseTransferMode` to `STREAM`.
- ASP.NET Core Integration with Response Streaming
For applications using the `Amazon.Lambda.AspNetCoreServer.Hosting` package, response streaming can be enabled by setting `EnableResponseStreaming` to `true` in the hosting options. The hosting layer automatically constructs the HTTP prelude and streams the body through the Lambda response stream, supporting standard ASP.NET Core endpoint return types.
Enhancements (1) ›
- Increased Response Size Limit
Response streaming increases the maximum Lambda response size from 6 MB to 200 MB. When used with Amazon API Gateway, the limit is 10 MB.
https://aws.amazon.com/blogs/developer/announcing-response-streaming-for-net-on-aws-lambda/
Related releases
- AWS IAM Role Manager Automates Service Role Setup AWS What's New ·
- Amazon Cognito integrates with Agent Toolkit for AWS AWS What's New ·
- AWS Lambda Console Adds Kiro and Cursor IDE Integration AWS What's New ·
- AWS Glue Schema Registry expands to 10 new regions AWS What's New ·
- AWS Lambda increases network bandwidth for functions outside VPC AWS What's New ·
- AWS Lambda increases SQS event pollers to 10,000 in Provisioned Mode AWS What's New ·