Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpWebRequest slow fix by setting Proxy to null

I rectified my HttpWebRequest initial calls being slow by using the suggestion mentioned at

Why is this WebRequest code slow?

One of the suggestions mentioned to set the Proxy to null and things will speed up.

I have done this and it worked.

However Im concerned about the impact of this when I deploy this at some client sites....

It may be at some client sites that have configured their domain to go through a proxy to reach the server in which I am making my HttpWebRequest to.

Will setting Proxy properly to null impinge upon this?

Thanks

like image 790
TheWommies Avatar asked Nov 14 '22 13:11

TheWommies


1 Answers

I wondered the same thing too. I was not able to find any answer to this question, though.

However, I did find that you can accomplish the same effect as hard coding httprequest.Proxy = null by adding a setting to the application config file:

<system.net>
  <defaultProxy>
    <proxy bypassonlocal="true" usesystemdefault="false" />
  </defaultProxy>
</system.net>

My thinking is that if I ever find myself at a customer site where I need to change the automatic proxy detection I can remove the settings from the config file.

I found this fix at the following site: http://weblog.west-wind.com/posts/2005/Dec/14/Slow-Http-client-calls-from-ASPNET-20-Make-sure-you-check-your-Proxy-Settings

like image 57
John Reichert Avatar answered Dec 06 '22 07:12

John Reichert