Response. Flush and response. bufferoutput

Source: Internet
Author: User

FirstResponse. BufferAttribute is out of date, and its only purpose is to ensure compatibility.ASP. You should useResponse. bufferoutputProperty to replace it.

The response. Flush method is used to immediately output the buffer data to the browser. You can call the response. Flush method multiple times. In this case, the browser will accept data multiple times instead of only one time.

Response. bufferoutput is a Boolean value indicating whether to buffer the output and send data in the buffer zone after the server completes processing on the entire page. True is the default value.

Whether the Server caches data depends on response. bufferoutput,When you set the value of response. bufferoutput to true, The data will be cached in the buffer, and after the page processing is completed, all the content in the buffer will be sent to the client at one time.If it is false, The data is not buffered, and each response is executed. the write method sends the data to the client immediately. The number of data transfers depends on how many response you use. write method. In this case, use response. the flush method is meaningless.The response. Flush method is meaningful only when you set the value of the response. bufferoutput attribute to true.At this time, the server sends all the data of the response. Write method before the response. Flush method is called to the client.

As long as the value of response. bufferoutput is set to true, the content in the buffer will be sent, only the problem of the morning and evening, the number of times, depending on the response. Flush method.

As for their functions, in a very large web page, you can use the response. Flush method to batch send data to the client, so that the browser can first present some htmlCodeAnd gradually complete presentation. This reduces the waiting time. However, you should note that the HTML code sent must be closed and complete; otherwise, Some browsers will not render HTML immediately, but will not render it until the complete HTML is accepted. Otherwise, it will have no effect.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.