Re: [whatwg] HTTP/2 push detection and control in JavaScript

> On Feb 20, 2015, at 11:53 AM, Kornel Lesiński <kornel@geekhood.net> wrote:
> 
> For server push we already have Server-Sent Events:
> 
> https://html.spec.whatwg.org/multipage/comms.html#server-sent-events <https://html.spec.whatwg.org/multipage/comms.html#server-sent-events>

Using an entirely different protocol to inform the JavaScript client of events that the browser is already aware of seems like overkill.

This also doesn’t solve the problem of canceling pushed streams.

> 
>> I’m not really concerned with how this is solved, but an example would be to add to XMLHTTPRequest:
> 
> XHR is dead.
> 
> https://fetch.spec.whatwg.org/

I’ll look into what would need to be added to this. Presumably we could just add an onpush event to Request which is fired with an event containing a new Request (containing info from the PUSH_PROMISE).

It’s not clear to me how we would cancel a pushed stream, or retrieve streaming body data without waiting for the request to completely finish.

Received on Friday, 20 February 2015 11:38:30 UTC