Response.Flush in ASP.NET

IIS5 enables buffering by default, therefore all the output from your ASP is actually sent to the browser only when the page completes its processing. In many cases this approach improves the overall processing speed, and indirectly makes for a more scalable site.

However, buffering has two minor defects:

  1. The end user might perceive a loss in speed, because she won’t see any output until the page is complete, and
  2. Buffered output has to be maintained on the server, therefore your ASP application is going to take more memory than it would do if buffering were disabled. On server machines with an inadequate amount of memory, large HTML pages can reduce the overall performance.

Fortunately, you can solve both problems with judicious use of the Response.Flush method, that lets you flush the output buffer periodically when sending a large amount of data back to the client. For example, if you are sending back to the client data from thousands of records, you might flush the buffer every 100 records, so that the end user sees some results earlier and you don’t tax the server’s memory.

Disadvantage of Response.Flush:

You can use the Response.Flush method. This method sends output up to that point to the client. Note that clients that connect over slow networks where buffering is turned off, affect the response time of your server. The response time of your server is affected because your server needs to wait for acknowledgements from the client. The acknowledgements from the client occur after the client receives all the content from the server.

For more info, you can read below articles:

Improving ASP.NET Performance

Response.Flush Method

Posted

in

by

Tags:


Related Posts

Comments

One response to “Response.Flush in ASP.NET”

  1. diinfotech software Avatar

    Thanks for the Information

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading