Search code examples
safarigoogle-chromecometlong-pollingtornado

Tornado streaming: flush() lagging on Safari & Chrome (Firefox is fine)


On Safari and Chrome, I won't be able to see flush() updates updating live on my page until after a certain number of flushes, or sometimes it hangs altogether on Safari. Flush updates work immediately on firefox though.

I'd like to know a couple things:

1) Why does Safari and Chrome lag out at the beginning with the flush updates, and then all of a sudden works normally later after I spam flushes?

2) Does flush() have a significant server performance gain over using finish() and then re-polling? how much?


Solution

  • found the answer... Safari and Chrome require extra stuff in the header content before they enter a continues flush stream mode. You can insert junk to ignore in the header and then let it stream.