You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Optional gzip compression of responses
* Format with formatOnSave
* Docs, rename env var, add 2 content-types
* Remove `unsafe` from integration test
* Add E2Es for compressed responses
* Code review fixes
Copy file name to clipboardExpand all lines: README.md
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,14 +69,15 @@ After passing readiness check, Lambda Web Adapter will start Lambda Runtime and
69
69
70
70
The readiness check port/path and traffic port can be configured using environment variables. These environment variables can be defined either within docker file or as Lambda function configuration.
| READINESS_CHECK_PROTOCOL | readiness check protocol: "http" or "tcp", default is "http" | "http" |
78
+
| ASYNC_INIT | enable asynchronous initialization for long initialization functions | "false" |
79
+
| REMOVE_BASE_PATH | (optional) the base path to be removed from request path | None |
80
+
| AWS_LWA_ENABLE_COMPRESSION | (optional) enable gzip compression for response body | "false" |
80
81
81
82
**ASYNC_INIT** Lambda managed runtimes offer up to 10 seconds for function initialization. During this period of time, Lambda functions have burst of CPU to accelerate initialization, and it is free.
82
83
If a lambda function couldn't complete the initialization within 10 seconds, Lambda will restart the function, and bill for the initialization.
@@ -85,6 +86,10 @@ When this feature is enabled, Lambda Web Adapter performs readiness check up to
85
86
Lambda Web Adapter signals to Lambda service that the init is completed, and continues readiness check in the handler.
86
87
This feature is disabled by default. Enable it by setting environment variable `ASYNC_INIT` to `true`.
87
88
89
+
**AWS_LWA_ENABLE_COMPRESSION** Lambda Web Adapter supports gzip compression for response body. This feature is disabled by default. Enable it by setting environment variable `AWS_LWA_ENABLE_COMPRESSION` to `true`.
90
+
When enabled, Lambda Web Adapter will check the `Accept-Encoding` header in the request, and compress the response body if the header contains `gzip`, if the response body is not already compressed, and if the `Content-Type` starts with `text/` or is `application/javascript`, `application/json`, `application/json+ld`, `application/xml`, `application/xhtml+xml`, `application/x-javascript`, or `image/svg+xml`.
91
+
Note that the `Content-Length` header will be set to the compressed size, not the original size.
92
+
88
93
**REMOVE_BASE_PATH** - The value of this environment variable tells the adapter whether the application is running under a base path.
89
94
For example, you could have configured your API Gateway to have a /orders/{proxy+} and a /catalog/{proxy+} resource.
90
95
Each resource is handled by a separate Lambda functions. For this reason, the application inside Lambda may not be aware of the fact that the /orders path exists.
0 commit comments