Files changed (1)
This leaves you with a static class, which passes through to a chosen `CacheMechanism`, with the correct type.
Finally! No more manual casting, remembering what the caching options should be, nor what the magic string is.
Let's say you want to cache blog posts and the generated HTML for some high traffic page in our ASP.Net website
There are currently two options for the CacheDictionary. Which one wokrs best for you will depend on your use case:
there could always be that one stray race condition that I didn't catch. Also, the tracking requires a few locks and it can possibly break if you have a LOT of different keys which will
seldom be acessed. Tracking a very large number of keys might make you hit the maximum object size limit, as well as possibly leaking memory. I recommend only using it if you really have to.
This is an extremely simple to implement interface to your caching method. Basically, nulls can not be cacheable is the only strict requirement. If a value is passed in as null, then
the value associated with the passed in key should be removed from the cache. Also, these methods MUST be thread-safe.