サーバーにマルチパート応答 (multipart/x-mixed-replace) を送信してもらいたい。Sinatra フレームワークまたは一般的な Rack アプリを使用した何らかのソリューションを希望しますが、Ruby の例はどれでもいいでしょう。PHPで私がやろうとしていることと同等のものは次のとおりです。
<?php
header('Content-type: multipart/x-mixed-replace;boundary="rn9012"');
print "--rn9012\n";
print "Content-type: application/xml\n\n";
print "<?xml version='1.0'?>\n";
print "<content>First Part</content>\n";
print "--rn9012\n";
flush();
sleep(5);
print "Content-type: application/xml\n\n";
print "<?xml version='1.0'?>\n";
print "<content>Second Part</content>\n";
print "--rn9012--\n";
?>