-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
We need to check for Transfer-Encoding: chunked on every HTTP/1.1 response.
This results in a call to HttpHeaders.ContainsParsedValue, which forces parsing of the Transfer-Encoding header (if present) into TransferCodingHeaderValue instances.
We can avoid allocating TransferCodingHeaderValue instances here by special casing the Transfer-Encoding parsing in this case and specifically looking only for the "chunked" value.
Note: There are probably similar issues with other response headers where we can avoid unnecessary overhead. I believe we have an issue where accessing Content-Length forces the Content-Length value to be boxed in the header store, which we could avoid. We should look at Connection: close as well. We may also have other similar issues on the request side for critical headers like Transfer-Encoding: chunked, Content-Length, Connection: close, Expect: 100-continue, Host, etc. Some of these apply to HTTP2/3 as well. We should investigate these and file issues as needed.