Is Response.End() considered harmful?

前端 未结 9 767
陌清茗
陌清茗 2020-11-22 01:01

This KB Article says that ASP.NET\'s Response.End() aborts a thread.

Reflector shows that it looks like this:

public void End()
{
            


        
9条回答
  •  无人共我
    2020-11-22 01:51

    On classic asp, I had a TTFB (Time To First Byte) of at 3 to 10 seconds on some ajax calls, much larger than the TTFB on regular pages with many more SQL calls.

    The ajax returned was a segment of HTML to be injected into the page.

    The TTFB was several seconds longer than the render time.

    If I added a response.end after the render, the TTFB was greatly reduced.

    I could get the same effect by emitting a "", but this probably doesn't work when outputting json or xml; here response.end is needed.

提交回复
热议问题