Skip to content

Add configuration by code for System.Runtime.Caching memory options #177

Description

@MichaConrad

The only way to configure the memory pressure or limits of the System.Runtime.Caching.MemoryCache based handle is via app/web.config.
The implementation already supports named caches, there could be at least overloads for the builder extension methods to define the following three properties...

//Create a name / value pair for properties
var config = new NameValueCollection();
config.Add("pollingInterval", "00:05:00");
config.Add("physicalMemoryLimitPercentage", "0");
config.Add("cacheMemoryLimitMegabytes", "10");

//instantiate cache
var cache = new MemoryCache("CustomCache", config);

API proposal:

.WithSystemRuntimeCacheHandle("CustomCache", pollingInterval: TimeSpan.FromMinutes(5), physicalMemoryLimitPercentage: 0, cacheMemoryLimitMegabytes: 10);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions