Geeks With Blogs
Reidar Husmo SharePoint from the trenches

I gave a SharePoint presentation at Norwegian SharePoint Community last week.

I wanted to have as smooth a presentation as possible by minimizing page load times.

The easiest way to do this, is to make sure that the pages you request are already cached.

And the easest way to do this, is to pre-request the pages.

...and an easy way to do this, is to have a PowerShell script request these pages in the background.

We just want to request the pages, we are not concerned with error status or how long it takes.

So turn off error messages.


[Net.WebClient] $wc = New-Object Net.WebClient

$wc.UseDefaultCredentials = $true

$ErrorActionPreference = "SilentlyContinue" # ignore errors

Do {

    $a = $wc.DownloadData("http://elvis:23959") # CA

    $a = $wc.DownloadData("http://elvis:23959/_admin/Contoso.Settings/ContosoSettings.aspx")

    $a = $wc.DownloadData("http://elvis:9001/sites/test04")

    $a = $wc.DownloadData("http://elvis:9000")

    Get-Date -DisplayHint Time

    Sleep(20)

}

While ($true)

 

The presentation went well, SharePoint responded quickly to my request. But I think this was more due to my Vaio Z than anything else, as "somebody" forgot to start the script...

Yes, I realize that there is something called keepalive, but it was faster and more fun to do it this way than to break out the Googlie.

Posted on Monday, February 13, 2012 12:22 PM SharePoint 2010 , Powershell | Back to top


Comments on this post: Cheating at SharePoint presentations

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Norgean | Powered by: GeeksWithBlogs.net