Solution Architecture

Currently In Progress
The solution uses a similar process to one that is already used by the internals of SharePoint. It just exposes a framework to allow you to hook into the same methods.

The components that make up the architecture are:-
  • Custom SharePoint List for Configuration (Cache Configuration List)
  • Custom SharePoint Timer Job
  • IIS Caching Object Model
  • Cache Manager object


Process Overview
The way that the framework works is that entries are made in the Configuration list which point to a file on all the server's local file system.

The framework comes with a custom CacheDependency which inherits from the standard CacheDependency class. This uses a file which when its changes causes a callback to occur which can be used with the System.Web.Caching.Cache object.

For each entry in the list a Cache Refresh Timer job is created which will modify the contents of the specified file on all the servers in the SharePoint farm. This inturn will cause the object which has been added using the SPCacheDependency class to be removed from the cache.

The nice thing is that the object is removed from a global cache which can be accessed by all SharePoint IIS processes and also other processes like the SharePoint Timer Service. Thus as long as these processes all use the same Cache they will all have the object unloaded/reloaded so that they are using the latest data.

Component Overview

Cache Configuration List
The Cache Configuration List provides the storage of the configuration of the Cache Refresh system.

The list contains the following metadata:-
  • Cache Key
    • Used as a unique id for working with the cache objects.
  • Description
    • Help administrators/developers to remind them what that cache configuration controls
  • Dependency File Path
    • This points to a file that is local to each server, but is used to refresh the cache.
  • Cache Lifetime
    • This is a configurable amount of time which allows the number of minutes that the objects live in the cache for. An object can be configured to live in the cache for the life of the cache's host process if this is set to zero.
  • Cache Enabled
    • Should the Cache Dependency Timer Job be enabled? Use this to switch off cache refresh of the objects.


Last edited Jul 7, 2012 at 11:41 PM by Quannum, version 2

Comments

No comments yet.