I have a Windows application that is connecting to a WCF Data Service hosted on the same machine.
The first thing that occurs when the application starts is a query that returns 0 to 3 results. Here's the code:
var environments = ctx.Environments
.AddQueryOption("$filter", "Environment eq '" + ConfigurationManager.AppSettings["environment"] + "'")
.AddQueryOption("$expand", "Departments, SecurityGroups");
The very next thing I do is check if (environments.Count() == 0) which takes about 10 seconds to evaluate. It seems to be slowest the first time, but always takes more than 6 seconds. However, if I'm running Fiddler, I always get the results back immediately.
Why does running Fiddler make it faster?
When you run fiddler it acts as a proxy for all the network calls, right? So probably this proxy responds faster than the real DNS host. What is the connection time out you've set in the binding configuration?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With