How to get the total return size of the webpage / bandwidth used to invoke the webpage

I use HttpWebRequest to call the page and HttpWebResponse to get the result,

My question is: how can I get or calculate the total byte return page size. In addition, I also want to know the traffic / bandwidth that I used to invoke the page.

I can get the length of the content, but the length of the content does not match Firebug or another network traffic program. So I'm not sure if the length of the content is the size of the page or not.

thanks

+7
source share
1 answer

Content.Length returns only the length of the HTML, after which the browser requests images and other javascript materials

1) Fiddler acts as a proxy server for calculating the bandwidth size, you can try to do the same 2) Another way that I see is to try to perform some calculations at the network level Look at the System.Net.NetworkInformation namespace, as well How to calculate network bandwidth speed in C # can help

Hope this helps

0
source

All Articles