Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IDistributedCache interface (synchronous) #3

Open
Dresel opened this issue Nov 6, 2020 · 0 comments
Open

Support IDistributedCache interface (synchronous) #3

Dresel opened this issue Nov 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Dresel
Copy link
Member

Dresel commented Nov 6, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant