0

I am building an application in C# that connects to a SharePoint website to backup data. The first time it connects it takes 100,000 milliseconds to get a response from the SharePoint site. While waiting the CPU usage is 0 and the Ram usage is stable. It still takes 100,000 milliseconds even when the username and password provided are incorrect.

Connection script:

ClientContext client = new ClientContext(SITE_URL);
context.Credentials = new SharePointOnlineCredentials(username, password);
context.ExecuteQuery();

The first call of ExecuteQuery takes 100 milliseconds regardless of what I ask it to load, but it is only the first request that has this delay.

tsfbsh
  • 1
  • 1
  • Is the site up? The IIS site, not the SharePoint site. If the site was idle for a long time (by default 20 minutes) IIS will kill shut down the worker process to release resources – Panagiotis Kanavos Oct 08 '21 at 10:41
  • I am not to sure what you mean by this? But the site is up and accessible, and everything runs nice and quickly apart from the very first call on ExecuteQuery(). Even setting a lower timeout of 5 seconds it will still wait 100 seconds to tell me it timed out. – tsfbsh Oct 08 '21 at 10:55

0 Answers0