Skip to content

Support IDistributedCache interface (synchronous) #3

@Dresel

Description

@Dresel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions