“Transfer-encoding: chunked” is not in the response header when using ARR

 

One of my customer is using ARR (Application Request Routing) in IIS8.5 as a reverse proxy to route the incoming requests to an application which does its own chunked transfer encoding. However, they find the “transfer-encoding: chunked” is not in the response header when using ARR, which causes the failure of the application connection.

Root Cause

=============

In IIS 7 and above, it automatically buffers responses data going back to the client, up to 4MB by default. If any application sends a response less than 4MB, IIS will buffer it in its entirety and send the response with a Content-Length header. If buffering is enabled and the application sends a response without a Content-Length header - and the response exceeds the buffer size or is explicitly flushed by the app before its complete - the buffering code will automatically chunk transfer encode the response if appropriate. If the application manually does its own chunked transfer encoding, it may strip the chunked transfer encoding and send the buffered response with a content-length.

Solution

=============

We can try to disable buffering by changing the Response Buffer Threshold (KB) to 0 in ARR Server Farm Proxy setting.

image

Here is a test of the solution by using ARR to route the request to a public chunkedimage page https://www.httpwatch.com/httpgallery/chunked/chunkedimage.aspx .

By default, when accessing this page through ARR, it will buffer the response and send the response with a Content-Length header.

image

When we change the Response Buffer Threshold (KB) to 0 in ARR Proxy setting. We can see the Transfer-Encoding: chunked in response header this time.

image

-Yingjie Shi from APAC DSI team