W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

[XHR2] Streamed send or receive

From: Wenbo Zhu <wenboz@google.com>
Date: Thu, 6 Oct 2011 00:57:33 -0700
Message-ID: <CAD3-0rOx4Ts23hbmEvQcZ9fVPRf=eDRSMjgR6Cr83RNTh_ivLg@mail.gmail.com>
To: public-webapps@w3.org
Cc: ian@hixie.ch
I'd like to hear from the WG if the following use cases or issues have been
discussed before.

1) When onreadystatechange is invoked as new response data is being
received, currently there is no way to clear any buffered responseText
(alike) that has already been consumed. The lack of such a capability will
force the server to disconnect to avoid memory overflow on the client-side,
e.g. when the server is streaming a large volume of text or binary data to
the client.

An example API to solve the above problem could be:

XMLHttpRequest.removeResponseText();      // return and clear any buffered
response data

2) Currently, request body has to be sent all at once. This is not desirable
when request data is computed from a streamed data source or from user
input. The lack of a programmatic way to send partial request data (as it is
being generated) will force the application to send multiple XHR requests.
Worse yet, it actually breaks the REST semantics of the target resource that
processes the "entire" POST body.

A simple API to solve this problem may look like:


- Wenbo
Received on Thursday, 6 October 2011 07:57:59 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC