I found myself writing to stringwriter then at the end of the function do a resp.Write(sw.ToString()). Is this unnecessary? If i were to use HttpResponse.Write several times could it potentially send data out multiple times (chunks) even if my page is 2k? How is HttpResponse.Write different from StringWriter.Write?
I found myself writing to stringwriter then at the end of the function do
Share
There’s no need to create an intermediate string in this case. You don’t need to worry about what the network stack is doing (whether HttpResponse.Write is broken into multiple low-level socket writes). However, you will get the best performance simply by writing the data as soon as you have it.