Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by tambourine_man on Friday October 18, 2013 @10:11AM
(#6571429)
This probably won't work if you have gzip on, right?
[ Parent
| on HN ]
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by joombar on Friday October 18, 2013 @10:19AM
(#6571479)
I'll have to test to be sure you still get streaming. It depends how the browsers handle xhr2 events with regard to gzip'd http. I /think/ it'll be fine but I need to check to be sure. Eg, with gzip on you still get progressive html rendering.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by tambourine_man on Friday October 18, 2013 @11:09AM
(#6571783)
From what I remember, Apache will send you a single chunk if you have it on, for example:
<?
echo 'Hey<br>';
flush();
ob_flush();
sleep(20);
echo 'Bye';
?>
Will send you "Hey<br>Bye" after 20sec instead of what you would expect (which does work with gzip off).Besides, even if you manage to stream it, I imagine inflating partially received content is not trivial for the browser.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by mbrock on Friday October 18, 2013 @11:40AM
(#6571962)
Gzip is a streaming format -- it's designed as a compressed format for communication streams. Browsers have no trouble with this. The Apache behavior you describe is probably related to buffering settings, which I think can be configured.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by joombar on Friday October 18, 2013 @02:28PM
(#6573103)
Quick experiment says: Gzip can be written out as a stream ok. Can't comment on Apache but Node does it fine.
Firefox's xhr fires progress events for gzipped content but not Chrome's. Looking to see if I can find a way round it.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by joombar on Friday October 18, 2013 @03:07PM
(#6573347)
In meantime, made a bug report: https://code.google.com/p/chromium/issues/detail?id=309092
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by jongleberry on Saturday October 19, 2013 @12:12AM
(#6575300)
in my experience, you need to set flush to SYNC for it to work on chrome without manually flushing
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by joombar on Saturday October 19, 2013 @06:05AM
(#6575927)
Do you know how to do that from node?
Here's the little test service I wrote to stream out some gzipped content:
https://github.com/jimhigson/oboe.js/blob/master/test/stream...
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for...
by jongleberry on Saturday October 19, 2013 @03:52PM
(#6577564)
You need to construct the stream with flush: require('zlib').Z_SYNC_FLUSH