This project is read-only.
Project Description
This an engine for caching SPSite and SPWeb objects on SharePoint. Because SharePoint dont alllow multithreaded access to these objects, the access is done through a threadpool

FASTSPWeb is an advanced threadpool engine that caches SharePoint objects automaticly in the webappliction process. By doing this SharePoint allows caching of SPWeb and SPSite objects in the whole user session. FASTSPWeb is caching both Elevated and users SPWeb and SPSite objects until it have reach a idle time for 20 min (can be changed). The engine allows you to "openweb" multiple number of times in your webpart, usercontrol etc. without having to worry about performance because the SPWeb is already open a no SharePoint API/SQL interaction is needed to access the SPWeb object. Correct dispoing of opened SPWeb and SPSite object is also not an issue because FASPSPWeb is handling all instantiating and disposing automaticlly.

Another benefit from not have to think of minimizing the amount of OpenWeb's in your application, is that the application can be design with having the SPWeb object referenced down through you application layers (business/data-layers etc). So the application can encapsulate all SharePoint activity in a single layer in your application and do multiple openweb in this layer. Normaly you would do the openweb (with using) in the top presentation layer and reference the opened SPWeb in every method down to your data-layer.

UPDATED 2011-03-21
I will be attending the conference SharePoint Saturday Copenhagen, on the 30.april 2011, as a speaker. Here I will do a session about the FastSPWeb CodePlex project.

UPDATED source 2011-03-11
  • FastItems cachepolicy : only default cachepolicy implementet
  • SPQuery cache : cache of SPQuery functionality l
  • "lasy" update() of items

SharePoint API extensions

FASTSPWeb has added 5 new methods to the SharePoint API.

For SPSite/SPWeb :
  • FastSPWebCall.OpenElevatedWeb(Site url/guid, Web Url/Guid) // Gives you a reference to a cached elevated SPSite and SPWeb
  • FastSPWebCall.OpenWeb(UserToken, Site url/guid, Web Url/Guid) // Gives you a reference to a cached user specific SPSite and SPWeb

For SPWeb.Lists:
  • Web.FastLists(CachePolicy) // Gives you a reference to a cached SPListCollection in the web

For SPList.Items:
  • list.FastItems(CachePolicy) // Gives you a reference to a cached SPListItemCollection in the list

For SPItem:
  • GUID FastUpdate(SPList) // Queues your update in the thread updater pool. Returns a Guid for parsing to method StatusForAction(guid)

General FASTSPWeb
  • bool StatusForAction(guid) // Throws an error if your udate did not complete without errors, otherwhise false for "pending/queued" or true for finshed without errors.

Programming example:

"Traditional" OpenWeb

using (SPSite _site = new SPSite("http://url"))
using (SPWeb web = site.OpenWeb())
SPList _list = _web.GetList("Lists/yourlist");
SPQuery _query = new SPQuery(_list.DefaultView);
SPListItemCollection _coll = _list.GetItems(_query);
// do work on the SPListItemCollection

FASTSPweb OpenWeb

List<Guid> ActionResultIdlist = new List<Guid>();

FastSPWebCall.OpenWeb(SPContext.Current.Web.CurrentUser, "http://url", "",
(site, web, hashCode) =>
_web.FastLists(FastSPWebCallExtensions.CachePolicy.FastSPDefault, (Lists) =>
SPList _list = null;
_list = Lists["YourList"];
_list.FastItems(FastSPWebCallExtensions.CachePolicy.FastSPDefault, (Items) =>
// work on your Items (SPListItemCollection)

SPListItem _item = Items[0]; // Update first element
_item["MyField"] = "Updated text";


Configuring / Tuning

FASTSPWeb can on-line be configured to contain more than one copy of the Elevated SPWeb object eg. 10 copies, to ensure that there always is a "free" SPWeb copy ready to handle the SharePoint task. FASTSPWeb can also on-line be configured to have more than one thread in the threadpool to handle the SharePoint task eg. 6 threads. This also ensures that there always is a free thread ready to handle the SharePoint application task.


FASPSPWeb is installed as a normal wsp package, and is contained in a webapplication feature, so FASPWeb can be installed on the SharePoint farm but only activated on specific webapplications.


FASPSPWeb requires SharePoint 2007 or Sharepoint 2010, .NET 3.5

Status of the project

FASPSPWeb needs a lot of testing, so please feel free to download and test the engine, then give me feedback.

  • bug identifying and fixing

Last edited Mar 21, 2011 at 9:44 PM by tsol, version 14