Cache Adapter 4.1 Released

Posted by: Glavs Blog, on 03 Mar 2016 | View original | Bookmarked: 0 time(s)

The latest version of cache adapter has now been released and is available via Nuget or you can download the source code here.

Note: For those who dont know what cache adapter is, you can check out the wiki here or you can look at some previous blog posts here which also has links to other posts.

The nuget packages for the core component and the package with all configuration and code examples are:


Please note: This release would not have been possible without contributions from the community, most notably Katrash. Your contributions are much appreciated even if my response and eventual action is somewhat slow.


What is in this release

This is only a relatively minor release but does contain some useful additions, as well as addressing some outstanding issues. The list of items addressed in this release are:

  • Targetting .Net 4.5.
  • Async method support.
  • Configurable Logging


Targetting .Net 4.5

CacheAdapter nuget package now only targets .Net 4.5 to allow the removal of Microsoft.Bcl packages from the dependency list which caused package bloat and was a much requested change for many users. These packages were only required when targetting versions of .Net prior to .Net 4.5 as the StackExchange.Redis package had these listed as dependencies. Glav.CacheAdapter depends upon StackExchange.Redis for its Redis support.

Async Method Support

Async method support is now available for all Get CacheProvider operations.

For all Get operations that also implicitly add data to the cache when a cache miss occurs, there are now the async  equivalents of these methods that will return a Task<T>.

So if previously you did something like:

var data = cacheProvider.Get<MyDataClass>(cacheKey, DateTime.Now.AddDays(1), () =>
{
   return dataStore.PerformQuery();
};

you can now use the async form of that method that returns a task. Using the above example, this would now become:

var data = await cacheProvider.GetAsync<MyDataClass>(cacheKey, DateTime.Now.AddDays(1), () =>
{
   return dataStore.PerformQueryAsync();
};



Configurable logging.

You can now disable/enable logging, log only errors, or log informational items which also includes errors. Previously this was left up to consumers to implement their own ILogging interface to allow whatever degree of confurability they want. As of this release, you now get the ability to perform basic configuration on the included logging component. This is specifed in configuration (like everything else), in the form:

  • <add key="Cache.LoggingLevel" value="Information"/> This logs everything and is the default. This is how prior versions operated.
  • <add key="Cache.LoggingLevel" value="ErrorsOnly"/> As the name suggests, only error information is logged.
  • <add key="Cache.LoggingLevel" value="None"/> Nothing is logged.


That is about it for the changes. Hope you find them useful. Feel free to let me know any suggestions or even perhaps create a pull request for any features you think are valuable additions.

Category: Visual Studio | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 318 | Hits: 8

Similar Posts

  • Announcing the Microsoft AJAX CDN more
  • Introducing The Windows Cache Extension for PHP more
  • Microsoft StreamInsight and BizTalk Server - Preliminary Thoughts more
  • ASP.NET disk-based caching more
  • Telerik OpenAccess ORM and the Second Level Cache more
  • Application Request Routing (ARR) Version 2 for IIS7 Beta 2 released. more
  • Are you caching your images and scripts? IIS SEO can tell you more
  • Don’t use Response.End() with OutputCache more
  • Stopping the panic: how to improve HtmlHelper.RenderPartial performances. Don’t run in debug mode more
  • Streaming large content from a WCF RESTFul service more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD