If a website is taking more than 10 seconds to process and load of a page, Internet Explorer will do a connection timeout. It is possible for the user to prevent this by setting the default value in the registry to a higher value.
But I really can’t tell any of my clients to do this; so how do I prevent this to happen in the first place?
I have always learned not to use a buffer and flush it, cause this will make the calculation of the data slower.
Another problem with this, is that all the calculation is being done first and put into a multidimensional array, which finally is posted with response.write. I dont think, that the buffer flush can do anything about this?
Yes it can:
It seems the timeout you’re referring to might be incorrectly set by a different application, as described in this question.
The KB article also states:
So you should flush data to the client, so it knows the server is still alive.
Please show sources for claims like this. Of course it will make the calculation slower, but most probably not significantly.
I like the approach suggested in the KB article. Let your server return immediately, while you enqueue the long running operation. The client can then poll about the progress of the operation, so it won’t timeout.