I Created a warm up Script for Sharepoint 2007 Farm, I am getting all URLs of webapps, sitecollections, sites, webs & subwebs in ArrayLists. After that I am using following code to get responce from each web, but its taking too much time, I was wondering if there is any alternative or better way to do it, and it will take less time/resources.
WebRequest request = WebRequest.Create(URL);
request.Proxy = null;
if ((userName == null) || (userName == ""))
{
request.Credentials = CredentialCache.DefaultCredentials;
}
else
{
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(URL), authType, new NetworkCredential(userName, password, domain));
request.Credentials = myCache;
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Console.WriteLine(response.StatusDescription);
using (Stream dataStream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(dataStream))
{
string responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
}
I tried on google but couldn’t find much related or I dont know how to make it related to this,
Cheers
If you aren’t worried about overloading the server, split the URL list and fire off 5 or 10 of these processes. There could be a lot of waiting when sending and receiving.