Can I Flush the Buffer Early Using ASP.NET?

前端 未结 2 1713
粉色の甜心
粉色の甜心 2021-02-14 03:02

Best Practices for Speeing Up Your Web Site from Yahoo includes the following recommendation:

When users request a page, it can take anywhere from 200 to 500

相关标签:
2条回答
  • 2021-02-14 03:30

    You might want to explicitly set Buffer=true in the @Page tag at the top of the page as well to avoid Response.Flush() throwing errors.

    0 讨论(0)
  • 2021-02-14 03:56

    You should be able to put the following in your page between the end of the head and the beginning of the body statement:

    <% Response.Flush(); %>
    

    However, be careful here in the event that you are using a script manager or any other kind of control that will register itself for output in the head section of the html.

    0 讨论(0)
提交回复
热议问题