Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Latest commit

 

History

History
37 lines (25 loc) · 1.28 KB

README.md

File metadata and controls

37 lines (25 loc) · 1.28 KB

BlendedCache

Blended Cache Framework for .net

Basic Principles:

  • 3 layers of caching:
    • Context (Thread based)
    • Volatile (in memory)
    • LongTerm (out of process)
  • Wraps up interaction of 3 layers, back filling. eg found in longTerm, put in context, volatile
  • Provides flush mode support for forcing refreshes at various layers.
  • Allows type load configuration to auto-load items.
  • LongTerm supports Refresh and Absolute expiration time. Also background refresh support with TypeLoadConfig
  • LongTerm supports Database down Func<bool> parameter to by pass expiration and keep system running.
  • LongTerm ideal permanent distributed cacheStore such as memcached, azure, etc.

Sample Context and Volatile for a website.

var contextCache = new HttpContextCache(); // IContextCache
var volatileCache = new RuntimeMemoryCachingVolatileCache();
var configuration = new BlendedCacheConfiguration();

//fancy ioc stuff here.
return new BlendedCache(contextCache, volatileCache, NullLongTermCache.NullInstance, configuration);

Building Source

NuGet auto-download is required to be configured to supply any third-parties.

  1. Tools -> Options -> Package Manager
  2. Check the box that says "Allow NuGet to download missing packages during build"