Skip to content
Jon P Smith edited this page Aug 2, 2022 · 8 revisions

Welcome to the Net.DistributedFileStoreCache documentation

This library provides a .NET distributed cache that has two excellent features

  • It can get cache values blistering fast –
    • It only takes ~25 ns. to Get one entry in a cache containing 10,000 entries.
    • It has methods called GetAllKeyValues \ GetAllKeyValues that return a dictionary with ALL 10,000 entries cache values in ~85 ns.
  • It uses a json file as the shared resource which makes it really easy to setup, and you don't need to setup / pay for a database for your cache.

The downsides are:

  • It’s slower than database caches when adding a new cache value. For instance, to Set a cache value to an existing 100 cache values takes ~1.5 ms., while a database would normally execute a Set in less than one millisecond. And it gets worse as the cache gets bigger - see the Performance Figures in the README file for the detailed.
  • It doesn't doesn’t implement the IDistributedCache’s SlidingExpiration feature, because that would make the read performance slow. But it does support the two AbsoluteExpiration versions.

The four distributed cache versions

The FileStore cache library has four versions of the code, with the big difference being the type of the value stored in the cache.

Version name Value type Description
String string Because the cache entries are stored in a json file a value of string is the this version runs everything
Class string + class This adds the ability to store complex data by serializing a class. This also has all the String version
Bytes byte[] This provides all the features in the String version, but with a value of byte[]
IDistributedCache byte[] This takes the Bytes version and register it against the IDistributedCache interface

Clone this wiki locally