Chunking vs Streaming (Response)

Not applicable

Chunking and streaming are completely different .

Streaming : For response size lesser than the buffer limit, MP would store it in the buffer like a normal response...and only stream if the size exceeds the buffer - but as a practice when we enable streaming better not touch the payload .

Chunking : Chunking with streaming is better as in case of chunks (transfer-encoded) we can't modify the payload anyway but chunking can work even if we don't enable streaming .

Is my understanding correct ?

@arghya das

Solved Solved
1 2 4,635
2 ACCEPTED SOLUTIONS

adas
New Member

@Maruti Chand That's mostly correct. Like you said, in case of streaming if the response size exceeds the buffer limit, we do streaming. When streaming is enabled certain policies that operate on the actual payload are automatically bypassed - XSLT, XML to JSON etc.

Chunking is HTTP 1.1 data transfer mechanism and nothing specific to Apigee. It uses the Transfer-Encoding HTTP header in place of the Content-Length header. In this case, you don't specify anything in the proxy or target endpoints in the apiproxy, its the transfer-encoding header in the request or response that informs the system about the nature of content, and the recipient waits for the last chunk before it starts operating on the payload. Hope that's clear.

View solution in original post

2 REPLIES 2

adas
New Member

@Maruti Chand That's mostly correct. Like you said, in case of streaming if the response size exceeds the buffer limit, we do streaming. When streaming is enabled certain policies that operate on the actual payload are automatically bypassed - XSLT, XML to JSON etc.

Chunking is HTTP 1.1 data transfer mechanism and nothing specific to Apigee. It uses the Transfer-Encoding HTTP header in place of the Content-Length header. In this case, you don't specify anything in the proxy or target endpoints in the apiproxy, its the transfer-encoding header in the request or response that informs the system about the nature of content, and the recipient waits for the last chunk before it starts operating on the payload. Hope that's clear.