I have a very simple node.js
server that I use to ping some servers I need to keep online.
Using Express I have a very simple endpoint I can access that will perform a loop of requests and report the results.
Using res.write()
on each loop, the webpage I load can show me the progress as it's happening.
The problem is, this progress doesn't happen in Safari
on either OS X
or iOS
. It waits until the process is complete and then dumps the whole output in 1 go.
Here's an example of my code:
router.route('/test').get(function(req, res)
{
res.write('<html><head></head><body>');
res.write('Starting tests...<br />');
performServerTests(req, res, function(results)
{ // Each loop within performServerTests also uses res.write()
res.write('<br />Complete');
res.end('</body></html>');
});
});
Is there a known reason why Safari would wait for the res.end()
call before displaying what it already has, while Chrome shows each res.write()
message as it receives it?
Thanks