.NET 4.0 introduced a new caching API that extends the previous existing API intended only for ASP.NET applications. The core of this new caching mechanism is the abstract class ObjectCache in the namespace System.Runtime.Caching. .NET provides a concrete implementation for in-memory caching through the MemoryCache class. However the in-memory cache is not suitable for some distributed scenarios.
This project provides a concrete implementation of the .NET Caching API, based on SQL Server, suitable for distributed scenarios.
The SqlCache implementation requires a table that should be created through the provided SQL script.
- Custom cache table name supported.
- Add Flush method to remove expired entries.
Whilst the Flush method is provided, a better approach to remove expired entries is using a SQL Job.
To use this library add a reference through Nuget: https://www.nuget.org/packages/Ovicus.Caching