<p>This problem started <a href="http://forums.asp.net/t/1304033.aspx" rel="nofollow noreferrer">on a different board</a>, but <a href="https://stackoverflow.com/users/60/dave-ward">Dave Ward</a>, who was very prompt and helpful there is also here, so I'd like to pick up here for hopefully the last remaining piece of the puzzle.­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>

<p>Basically, I was looking for a way to do constant updates to a web page from a long process. I thought AJAX was the way to go, but Dave has <a href="http://encosia.com/2007/10/03/easy-incremental-status-updates-for-long-requests/" rel="nofollow noreferrer">a nice article about using JavaScript</a>. I integrated it into my application and it worked great on my client, but NOT my server WebHost4Life. I have another server @ Brinkster and decided to try it there and it DOES work. All the code is the same on my client, WebHost4Life, and Brinkster, so there's obviously something going on with WebHost4Life.</p>

<p>I'm planning to write an email to them or request technical support, but I'd like to be proactive and try to figure out what could be going on with their end to cause this difference. I did everything I could with my code to turn off Buffering like <code>Page.Response.BufferOutput = False</code>. What server settings could they have implemented to cause this difference? Is there any way I could circumvent it on my own without their help? If not, what would they need to do?</p>

<p>For reference, a link to the working version of a simpler version of my application is located @ <a href="http://www.jasoncomedy.com/javascriptfun/javascriptfun.aspx" rel="nofollow noreferrer">http://www.jasoncomedy.com/javascriptfun/javascriptfun.aspx</a> and the same version that isn't working is located @ <a href="http://www.tabroom.org/Ajaxfun/Default.aspx" rel="nofollow noreferrer">http://www.tabroom.org/Ajaxfun/Default.aspx</a>. You'll notice in the working version, you get updates with each step, but in the one that doesn't, it sits there for a long time until everything is done and then does all the updates to the client at once ... and that makes me sad.</p>

[{'answer_id': 25031, 'author': 'Mark Brackett', 'author_id': 2199, 'author_profile': 'https://Stackoverflow.com/users/2199', 'pm_score': 2, 'selected': False, 'text': "<p>I don't know that you can force buffering - but a reverse proxy server between you and the server would affect buffering (since the buffer then affects the proxy's connection - not your browser's).</p>\n"}, {'answer_id': 25034, 'author': 'Leon Bambrick', 'author_id': 49, 'author_profile': 'https://Stackoverflow.com/users/49', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve done some fruitless research on this one, but i\'ll share my line of thinking in the dim hope that it helps.</p>\n\n<p>IIS is one of the things sitting between client and server in this case, so it might be useful to know what version of IIS is involved in each case -- and to investigate if there\'s some way that IIS can perform its own buffering on an open connection.</p>\n\n<p>Though it\'s not quite on the money, this article about <a href="http://support.microsoft.com/?id=840875" rel="nofollow noreferrer">IIS6 v IIS 5</a> is the kind of thing I\'m thinking of.</p>\n'}, {'answer_id': 26475, 'author': 'kamens', 'author_id': 1335, 'author_profile': 'https://Stackoverflow.com/users/1335', 'pm_score': 2, 'selected': False, 'text': '<p>You should make sure that neither IIS nor any other filter is trying to compress your response.  It is very possible that your production server has IIS compression enabled for dynamic pages such as those with the .aspx suffix, and your development server does not.</p>\n\n<p>If this is the case, IIS may be waiting for the entire response (or a sizeable chunk) before it attempts to compress and send any result back to the client.</p>\n\n<p>I suggest using <a href="http://www.fiddlertool.com" rel="nofollow noreferrer">Fiddler</a> to monitor the response from your production server and figure out if responses are being gzip\'d.</p>\n\n<p>If response compression does turn out to be the problem, you can instruct IIS to ignore compression for specific responses via the Content-Encoding:Identity header.</p>\n'}, {'answer_id': 26483, 'author': 'Dave Ward', 'author_id': 60, 'author_profile': 'https://Stackoverflow.com/users/60', 'pm_score': 3, 'selected': False, 'text': '<p>Hey, Jason.  Sorry you\'re still having trouble with this.</p>\n\n<p>What I would do is set up a simple page like:</p>\n\n<pre><code>protected void Page_Load(object sender, EventArgs e)\n{\n  for (int i = 0; i &lt; 10; i++) \n  {\n    Response.Write(i + "&lt;br /&gt;"); \n    Response.Flush();\n\n    Thread.Sleep(1000);\n  }\n}\n</code></pre>\n\n<p>As we discussed before, make sure the .aspx file is empty of any markup other than the @Page declaration.  That can sometimes trigger page buffering when it wouldn\'t have normally happened.</p>\n\n<p>Then, point the tech support guys to that file and describe the desired behavior (10 updates, 1 per second).  I\'ve found that giving them a simple test case goes a long way toward getting these things resolved.</p>\n\n<p>Definitely let us know what it ends up being.  I\'m guessing some sort of inline caching or reverse proxy, but I\'m curious.</p>\n'}, {'answer_id': 46425529, 'author': 'Duncan Smart', 'author_id': 1278, 'author_profile': 'https://Stackoverflow.com/users/1278', 'pm_score': 2, 'selected': False, 'text': '<p>The issue is that IIS will further buffer output (beyond ASP.NET\'s buffering) if you have <strong>dynamic gzip compression</strong> turned on (it is by default these days). </p>\n\n<p>Therefore to stop IIS buffering your response there\'s a little hack you can do to fool IIS into thinking that the client can\'t handle compression by overwriting the <code>Request.Headers["Accept-Encoding"]</code> header (yes, <strong>Request</strong>.Headers, trust me):</p>\n\n<pre><code>Response.BufferOutput = false;\nRequest.Headers["Accept-Encoding"] = ""; // suppresses gzip compression on output\n</code></pre>\n\n<p>As it\'s sending the response, the IIS compression filter checks the request headers for <code>Accept-Encoding: gzip ...</code> and if it\'s not there, doesn\'t compress (and therefore further buffer the output).</p>\n'}]
['https://Stackoverflow.com/questions/24821', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1953/']