Page buffer and ASP. NET performance optimization (set the page. Buffer attribute)

Source: Internet
Author: User

The page. Buffer attribute in ASP. NET is used to buffer page execution results. It is generally set in the @ page command. The default value is true. This attribute is applicable to web optimization.ProgramThe performance is useful, as described below:

Set buffer to false:

The page is not buffered, And the execution results are successively sent to the browser. When there is a lot of page content, it is divided into many small parts and sent to the browser, in addition, the next part can be executed and sent only after the previous part is received by the browser.

Therefore, for remote access, the page execution time will become long, because the page execution time depends on the network transmission speed. Therefore, it is generally not set to false.

Set buffer to true:

Page buffering, all execution results are buffered, and then sent together to the browser client. In this case, the execution time on the page does not depend on the network speed, because the page is not transmitted over the network.

However, you should also note that setting the buffer to true will slow the webpage response time. If it is a page that runs complex computing, it is inappropriate to send content to the browser client after a long operation is completed (the browser will not receive any content for a long time ). The general processing method is to manually call the flush method after executing a part of the content to send it to the client first.

Related Article

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.