Documentation Index Fetch the complete documentation index at: https://easyaf.dev/llms.txt
Use this file to discover all available pages before exploring further.
Definition
Assembly: Microsoft.OData.Mcp.Core.dll
Namespace: Microsoft.OData.Mcp.Core.Configuration
Inheritance: System.Object
Syntax
Microsoft . OData . Mcp . Core . Configuration . CachingConfiguration
Summary
Configuration for metadata and tool caching behavior.
Caching configuration controls how long metadata and generated tools are cached
to improve performance and reduce load on the underlying OData service.
This class provides comprehensive caching options including provider selection,
TTL settings, size limits, and advanced features like compression and warming.
Constructors
.ctor
Initializes a new instance of the CachingConfiguration class.
Syntax
public CachingConfiguration ()
.ctor Inherited
Syntax
Properties
Compression
Gets or sets the compression configuration for cached data.
Syntax
public Microsoft . OData . Mcp . Core . Configuration . CacheCompressionConfiguration Compression { get ; set ; }
Property Value
Type: Microsoft.OData.Mcp.Core.Configuration.CacheCompressionConfiguration
Configuration for compressing cached data to save memory/storage.
Cache compression can significantly reduce memory usage for large
cached objects at the cost of additional CPU overhead.
CustomProperties
Gets or sets custom caching properties.
Syntax
public System . Collections . Generic . Dictionary < string , object > CustomProperties { get ; set ; }
Property Value
Type: System.Collections.Generic.Dictionary<string, object>
A dictionary of custom caching configuration values.
Custom properties allow extending the configuration with cache provider-specific
settings that don’t fit into the standard configuration properties.
DistributedCache
Gets or sets the distributed cache configuration.
Syntax
public Microsoft . OData . Mcp . Core . Configuration . DistributedCacheConfiguration DistributedCache { get ; set ; }
Property Value
Type: Microsoft.OData.Mcp.Core.Configuration.DistributedCacheConfiguration
Configuration for distributed caching across multiple server instances.
Distributed caching enables cache sharing between multiple MCP server
instances for improved consistency and performance.
Enabled
Gets or sets a value indicating whether caching is enabled.
Syntax
public bool Enabled { get ; set ; }
Property Value
Type: bool
true to enable caching; otherwise, false.
When caching is disabled, metadata and tools will be regenerated for every request,
which can impact performance but ensures the latest data is always used.
EnableStatistics
Gets or sets a value indicating whether to enable cache statistics collection.
Syntax
public bool EnableStatistics { get ; set ; }
Property Value
Type: bool
true to collect cache statistics; otherwise, false.
Cache statistics provide insights into cache hit rates, evictions,
and performance metrics for monitoring and optimization.
EnableWarming
Gets or sets a value indicating whether to enable cache warming.
Syntax
public bool EnableWarming { get ; set ; }
Property Value
Type: bool
true to pre-populate the cache on startup; otherwise, false.
Cache warming pre-populates frequently accessed data to improve
initial response times after server startup.
EvictionPolicy
Gets or sets the cache eviction policy.
Syntax
public Microsoft . OData . Mcp . Core . Configuration . CacheEvictionPolicy EvictionPolicy { get ; set ; }
Property Value
Type: Microsoft.OData.Mcp.Core.Configuration.CacheEvictionPolicy
The policy used to determine which entries to evict when cache limits are reached.
Different eviction policies optimize for different access patterns
and performance characteristics.
KeyPrefix
Gets or sets the cache key prefix.
Syntax
public string KeyPrefix { get ; set ; }
Property Value
Type: string
A prefix added to all cache keys to avoid collisions.
Key prefixes are useful when multiple MCP server instances share
the same cache infrastructure.
MaxEntries
Gets or sets the maximum number of cache entries.
Syntax
public System . Nullable < int > MaxEntries { get ; set ; }
Property Value
Type: System.Nullable<int>
The maximum number of entries in the cache, or null for no limit.
Entry count limits provide an alternative way to control cache size
when individual entry sizes vary significantly.
MaxSizeMb
Gets or sets the maximum size of the cache in megabytes.
Syntax
public System . Nullable < int > MaxSizeMb { get ; set ; }
Property Value
Type: System.Nullable<int>
The maximum cache size in MB, or null for no limit.
Cache size limits prevent excessive memory usage. When the limit is reached,
older entries will be evicted using the configured eviction policy.
Gets or sets the Time-To-Live (TTL) for metadata cache entries.
Syntax
public System . TimeSpan MetadataTtl { get ; set ; }
Property Value
Type: System.TimeSpan
The duration to cache metadata before it expires.
Metadata is typically stable and can be cached for longer periods.
A shorter TTL ensures faster detection of schema changes.
ProviderType
Gets or sets the cache provider type.
Syntax
public Microsoft . OData . Mcp . Core . Configuration . CacheProviderType ProviderType { get ; set ; }
Property Value
Type: Microsoft.OData.Mcp.Core.Configuration.CacheProviderType
The type of cache provider to use.
Different cache providers offer different characteristics in terms of
persistence, performance, and distributed caching capabilities.
QueryResultsTtl
Gets or sets the Time-To-Live (TTL) for query result cache entries.
Syntax
public System . TimeSpan QueryResultsTtl { get ; set ; }
Property Value
Type: System.TimeSpan
The duration to cache query results before they expire.
Query results represent actual data and should typically have shorter
TTL values to ensure data freshness.
Gets or sets the Time-To-Live (TTL) for generated tools cache entries.
Syntax
public System . TimeSpan ToolsTtl { get ; set ; }
Property Value
Type: System.TimeSpan
The duration to cache generated tools before they expire.
Generated tools are derived from metadata and can be cached separately
with different TTL values for performance optimization.
WarmingDelay
Gets or sets the cache warming delay after startup.
Syntax
public System . TimeSpan WarmingDelay { get ; set ; }
Property Value
Type: System.TimeSpan
The delay before starting cache warming operations.
A startup delay allows the server to fully initialize before
beginning resource-intensive cache warming operations.
Methods
Clone
Creates a copy of this configuration.
Syntax
public Microsoft . OData . Mcp . Core . Configuration . CachingConfiguration Clone ()
Returns
Type: Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration
A new instance with the same settings.
Disabled
Creates a configuration with caching disabled.
Syntax
public static Microsoft . OData . Mcp . Core . Configuration . CachingConfiguration Disabled ()
Returns
Type: Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration
A caching configuration with all caching disabled.
Disabled caching ensures the freshest data is always retrieved
at the cost of performance. Useful for debugging or when
data consistency is more important than performance.
Equals Inherited Virtual
Syntax
public virtual bool Equals ( object obj )
Parameters
Name Type Description objobject?-
Returns
Type: bool
Equals Inherited
Syntax
public static bool Equals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
Returns
Type: bool
ForDevelopment
Creates a configuration optimized for development environments.
Syntax
public static Microsoft . OData . Mcp . Core . Configuration . CachingConfiguration ForDevelopment ()
Returns
Type: Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration
A caching configuration suitable for development.
Development configurations use shorter TTLs and smaller cache sizes
to ensure faster detection of changes during development cycles.
ForProduction
Creates a configuration optimized for production environments.
Syntax
public static Microsoft . OData . Mcp . Core . Configuration . CachingConfiguration ForProduction ()
Returns
Type: Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration
A caching configuration suitable for production.
Production configurations use longer TTLs, larger cache sizes,
and enable advanced features like compression and warming for
optimal performance.
GetHashCode Inherited Virtual
Syntax
public virtual int GetHashCode ()
Returns
Type: int
Gets the cache key for a metadata entry.
Syntax
public string GetMetadataKey ( string serviceUrl )
Parameters
Name Type Description serviceUrlstringThe OData service URL.
Returns
Type: string
The cache key for the metadata.
Exceptions
Exception Description ArgumentExceptionThrown when serviceUrl is null or whitespace.
GetQueryResultKey
Gets the cache key for a query result entry.
Syntax
public string GetQueryResultKey ( string serviceUrl , string queryHash , string userContext = null )
Parameters
Name Type Description serviceUrlstringThe OData service URL. queryHashstringThe hash of the query parameters. userContextstring?Optional user context for user-specific caching.
Returns
Type: string
The cache key for the query result.
Exceptions
Exception Description ArgumentExceptionThrown when serviceUrl is null or whitespace.
Gets the cache key for a tools entry.
Syntax
public string GetToolsKey ( string serviceUrl , string optionsHash )
Parameters
Name Type Description serviceUrlstringThe OData service URL. optionsHashstringThe hash of the tool generation options.
Returns
Type: string
The cache key for the tools.
Exceptions
Exception Description ArgumentExceptionThrown when serviceUrl is null or whitespace.
GetType Inherited
Syntax
public System . Type GetType ()
Returns
Type: System.Type
MemberwiseClone Inherited
Syntax
protected internal object MemberwiseClone ()
Returns
Type: object
MergeWith
Merges another configuration into this one, with the other configuration taking precedence.
Syntax
public void MergeWith ( Microsoft . OData . Mcp . Core . Configuration . CachingConfiguration other )
Parameters
Name Type Description otherMicrosoft.OData.Mcp.Core.Configuration.CachingConfigurationThe configuration to merge into this one.
Exceptions
Exception Description ArgumentNullExceptionThrown when other is null.
ReferenceEquals Inherited
Syntax
public static bool ReferenceEquals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
Returns
Type: bool
ToString Inherited Virtual
Syntax
public virtual string ToString ()
Returns
Type: string?
Validate
Validates the caching configuration.
Syntax
public System . Collections . Generic . IEnumerable < string > Validate ()
Returns
Type: System.Collections.Generic.IEnumerable<string>
A collection of validation errors, or empty if the configuration is valid.