[XHR] chunked

A while ago sicking proposed adding chunked support to XMLHttpRequest:

http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0741.html
https://bugzilla.mozilla.org/show_bug.cgi?id=687087

A use case I remember was downloading a large file of some kind that  
presumably can be incrementally rendered as otherwise responseType "blob"  
should be sufficient. More use cases appreciated. Would help with the  
design.

As for the feature, basically have responseType "chunked-text" and  
"chunked-arraybuffer" values and reset rather than update the response  
entity body with each progress event. And make sure that a progress event  
is dispatched when the last fetch event is queued. And make sure that this  
is only available for asynchronous usage.

Charles asked whether "chunked-text" was really needed (and whether we  
should have "chunked" which implies ArrayBuffer instead). Nobody got back  
to him on that. If it is needed, how does it work when you just have some  
of the bytes of a multi-byte character in a single chunk? Fails to decode  
as per the normal algorithm?

Also, this basically makes it possible to write EventSource on top of  
XMLHttpRequest. Is that acceptable? If it encourages more people to use a  
lower-level API, higher-level optimizations for mobile phones might become  
harder down the road.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Wednesday, 30 November 2011 15:28:48 UTC