0

I noticed that chunked encoding is ideal for transfers of web page content where size is unknown. If I'm compelled to use HTTP for file uploads and downloads, is it valid to use the chunked encoding feature of HTTP/1.1 for performance benefit? Or should I implement chunking at the application layer?

EDIT: By performance benefit I imply the performance of the data transfer over the wire. Can chunking improve the upload and download times? Or am I going against its intent?

Krishter
  • 489
  • 8
  • 24

1 Answers1

0

There is not necessarily a performance benefit to chunking here. It depends what you're trying to accomplish. For example, if you want to avoid having an entire response in memory at once, chunking can prevent the need to calculate content length. But that's not necessarily a performance win. See, for example,http://zoompf.com/blog/2012/05/too-chunky. Some advantages of application-level chunking would be control over failures, and upload progress tracking.

Bosh
  • 8,138
  • 11
  • 51
  • 77
  • Thank you for the response. By performance I meant the file transfer performance. Can I improve it with chunking? I have edited my question to reflect this. – Krishter Mar 03 '15 at 08:22
  • Evaluating your criterion strictly: no, chunked transfers will not increase throughput. – Bosh Mar 03 '15 at 19:14
  • Could you elaborate, please? – Krishter Mar 04 '15 at 04:02
  • Breaking the transmission into serialized chunks simply does not cause more bits per second to flow over the wire. It's not a very deep point -- but it's true. – Bosh Mar 04 '15 at 07:24