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.