Invoking a response streaming enabled function using Lambda function URLs
Note
You must invoke your function using a function URL to stream the responses.
You can invoke response streaming enabled functions by changing the invoke mode of your function's URL. The invoke mode determines which API operation Lambda uses to invoke your function. The available invoke modes are:
-
BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. -
RESPONSE_STREAM
– Enables your function to stream payload results as they become available. Lambda invokes your function using theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB. However, you can request a quota increase.
You can still invoke your function without response streaming by directly calling the
Invoke
API operation. However, Lambda streams all response payloads for
invocations that come through the function's URL until you change the invoke mode to
BUFFERED
.
For more information about configuring function URLs, see Lambda function URLs.