-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Support the usage of caches based on the IDistributedCache interface.
For the first iteration only the following synchronous methods will be used:
// IDistributedCache interface
byte[] Get(string key);
// DistributedCacheExtensions
public static void Set (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value);The key has to be formatted as string. We will provide a default implementation, similar to the old MethodCache where the ToString() representations of arguments will be concatenated and delimited by a configurable char ('_' will be used as default).
This should be sufficient for most use cases. Customization will be possible by providing a IDistributedCacheKeyFormatter implementation.
The same challenge applies to the value which has to be formatted as byte[]. Customization will be possible by providing a IDistributedCacheValueFormatter implementation. We might consider a default implementation (probably JSON.Net serialization / deserialization).