Introduction

Large complex forms with multiple views, states, events and actions can take a long time to initially load. To improve the performance of these complex forms, you can run a PowerShell script to perform the initial IIS caching of the form prior to the first time someone opens it, reducing the loading time and minimizing the potential effects of an IIS reset.

Note: 
  1. Run this script to pre-cache forms. Typically, after an IISRESET or Reboot has occurred.
  2. Edit the $urls variable to include one or more URLs to your forms, and update the Start-Sleep milliseconds to match how long it takes your biggest form to cache.

To enable IIS caching of a form, follow these steps:

  1. Ensure that Internet Explorer is on the K2 Server as the script starts an instance of IE.
  2. Download the attached script.
  3. Edit the $urls variable, pointing it to the runtime URLs of the forms which you can see when looking at the properties of the form. Update the Start-Sleep milliseconds to match how long it takes your biggest form to cache.
  4. Run the PowerShell script.
  5. Optional: Create a warm-up script trigger when an IISRESET or server reboot occurs. For more information see Expanding warm up script trigger (Navigating the SharePoint Maze blog post)