Giter Site home page Giter Site logo

debugoftheroad / cachemanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michaco/cachemanager

0.0 2.0 0.0 5.71 MB

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.

Home Page: http://cachemanager.net

License: Apache License 2.0

Batchfile 0.02% PowerShell 0.18% Shell 0.12% C# 99.68%

cachemanager's Introduction

CacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.

The main goal of the CacheManager package is to make developer's life easier to handle even very complex caching scenarios.
With CacheManager it is possible to implement multiple layers of caching, e.g. in-process caching in front of a distributed cache, in just a few lines of code.

CacheManager is not just an interface to unify the programming model for various cache providers, which will make it very easy to change the caching strategy later on in a project. It also offers additional features, like cache synchronization, concurrent updates, serialization, events, performance counters... The developer can opt-in to those features only if needed.

Build Status

Build Server Status
Windows, KoreBuild Build status
Windows, MSBuild Build status
Linux, Mono Build Status

CacheManager Nuget Packages

Package Name .Net 4.0 .Net 4.5 Minimum .NET Platform Standard version *
[CacheManager.Core] Core.nuget x x 1.1
[CacheManager.StackExchange.Redis] Redis.nuget x x 1.5
[CacheManager.SystemRuntimeCaching] SystemRuntimeCaching.nuget x x -
[CacheManager.Microsoft.Extensions.Caching.Memory] MSCache.nuget - >=4.5.1 1.3
[CacheManager.Microsoft.Extensions.Configuration] Configuration.nuget - x 1.3
[CacheManager.Microsoft.Extensions.Logging] Logging.nuget - x 1.3
[CacheManager.Serialization.Json] Json.nuget x x 1.2
[CacheManager.Serialization.ProtoBuf] ProtoBuf.nuget x x 1.3
[CacheManager.Web] Web.nuget - x -
[CacheManager.Memcached] Memcached.nuget x x -
[CacheManager.Couchbase] Couchbase.nuget - x -

* "Minimum .NET Platform Standard" version means, that at least the listed version per package must be targeted if you want to use it. See the documentation for more details of what .NET platform standard means.

Beta Packages

Beta versions of the CacheManager packages are getting pushed to https://www.myget.org/gallery/cachemanager on each build. Add the following feed, if you want to play with the not yet released bits:

https://www.myget.org/F/cachemanager/api/v3/index.json

To find which check-in created which build, use this build history.

Documentation

Documentation can be found within the articles folder of the Cache Manager's repository and hosted on my website:

  • Getting Started Is a very basic introduction of how to install and use Cache Manager
  • Configuration Explains how to configure Cache Manager via code or configuration file
  • Features and Architecture A more advanced in depth introduction to all features of Cache Manager
  • Update Operations Explanation of why and when to use the update method instead of Put
  • Serialization Cache value serialization and configuration options explained in detail.
  • Cache Synchronization Use case for and explanation of the Cache Backplane feature.
  • Logging The logging abstraction and implementations explained

There is also from source generated html documentation available online.

Examples

Features in Version: 0.9.x

  • One common interface for handling different caching technologies: ICache<T>
  • Configurable by
    • Code with many different paths and a fluent configuration builder
    • Microsoft.Extensions.Configuration
    • App/Web.config
    • See configuration docs
  • Support for different cache providers
  • Serialization can now be configured. Serialization is only needed in distributed caches. If no additional serialization package is installed and configured, Binary serialization will be used (if available) The following are the currently available serialization options:
    • Binary (build in if the full CLR is being used)
    • Json based on the popular Newtonsoft.Json library
    • Json with Gzip compression
    • Protocol Buffer Google's protobuf. The package uses Mark's protobuf-net implementation.
  • Update values with lock or transaction for distributed caches. The interfaced provides a simple update method which internally ensures you work with the latest version. And CacheManager handles version conflicts for you.
  • Logging CacheManager comes with an extensible logging API (see samples).
    • All standard cache operations are logged
    • Based on log levels more or less information will be logged (try Trace and Debug)
    • Current concrete implementation is based on the ASP.NET Core logging. Other implementation of CacheManager's ILoggerFactory might follow.
  • Strongly typed cache interface.
  • Multiple layers By having multiple cache handles managed by CacheManager, you can easily implement layered caches. For example, an in process cache in front of your distributed cache, to make read access faster. CacheManager will synchronize those layers for you.
    • Put and Add operations will always be executed on all cache handles registered on the manager.
    • On Get, there are different configuration options defined by CacheUpdateMode, if the item was available in one cache handle:
      • None: No update across the cache handles on Get
      • Up: Updates the handles "above"
      • All: Updates/Adds the item to all handles
  • Expiration: It is possible to configure the expiration per cache handle within the manager or per cache item. The following are the supported expiration modes:
    • Sliding expiration: On cache hit, the cache item expiration timeout will be extended by the configured amount.
    • Absolute expiration: The cache item will expire after the configured timeout.
  • Cache Regions: Even if some cache systems do not support or implement cache regions, the CacheManager implements the mechanism. This can be used to for example group elements and remove all of them at once.
  • Statistics: Counters for all kind of cache actions.
  • Performance Counters: To be able to inspect certain numbers with perfmon, CacheManager supports performance counters per instance of the manager and per cache handle.
  • Event System: CacheManager triggers events for common cache actions: OnGet, OnAdd, OnPut, OnRemove, OnClear, OnClearRegion
  • System.Web.OutputCache implementation to use CacheManager as OutputCache provider which makes the OutputCache extremely flexible, for example by using a distributed cache like Redis across many web servers.
  • Cache clients synchronization
    • Implemented with the Redis pub/sub feature
    • (Other implementations without Redis might be an option for a later version)
  • Supports .Net 4.0, .Net 4.5, and can be used in cross platform projects with the new .NET Core runtime

[TOC]

cachemanager's People

Contributors

auroradysis avatar fgideali avatar kriskit avatar michaco avatar michael-baker avatar wenisman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.