I canβt give you an answer, because we donβt have enough information, but to track your problem ...
First, try querying AD using standard tools (running on a web server) - is it just as slow? If so, it is probably a mains / dc problem.
Assuming this is your slow implementation ...
Are you calling the WCF service hosted on the website to collect / download ? To test this, make several calls and compare the delays. If the first is much longer, look at the IIS settings. 0 To reduce the problem, you can increase the downtime before downloading the application, etc.
If you are sure that your code takes too much time, use Visual Studio Pofiler , which will determine which functions / calls cause a delay - if it is in your code, optimize it. If it is within the framework, then you are either using it incorrectly or you have discovered a problem with the framework (unlikely).
If you can edit your question to include answers to the above, we can help further
Edit:. In response to the question about caching in WCF, there are several ways to approach this - you can replace the storage provider for the service class to make it single - then you can just use private variables / memory for caching. This requires your class to be thread safe.
Alternatives include: database, file system, shared cache in memory ( System.Runtime.Caching )
Basic source share