Eiffel
  • Overview
    • About
  • Features
    • Cross cutting concerns
      • API response consistency
      • Global exception handling
      • Idempotency
      • Audit logging
    • Caching
      • Configuration
        • In-Memory
        • Redis
      • Usage
      • API
        • CacheSource
        • InMemoryCacheOptions
        • RedisCacheOptions
        • ICacheService
        • ICacheServiceFactory
    • Localization
    • Job Processing
    • Multi-Tenancy
    • Metrics & monitoring
    • Transactional outbox
      • PostgreSQL
      • MongoDB (cluster only)
    • Messaging
      • Kafka
      • Rabbit MQ
      • Azure Service Bus
    • Awaitable socket client
    • Graceful shutdown
  • Fundamentals
    • Persistence
    • Modelling
  • Principles
    • Domain-Driven Design
      • Aggregates
      • Entities
      • Value Objects
      • Domain Events
      • Factories
      • Domain Services
      • Business Identifiers
      • Shared Kernel
    • Onion Architecture
      • Application Layer
      • Domain Layer
      • Infrastructure Layer
      • Anti-Corruption Layer
    • Modular Monolith Architecture
      • Modules
      • Shared Infrastructure
    • Microservice Architecture
      • API Gateway
      • View Model Composition
      • Contracts
  • Business Aligment
    • Domain Storytelling
    • User stories
  • Implementation
    • Modular Monolith
    • Microservices
  • Testing
    • Unit Testing
    • Integration Testing
    • Contract Testing
  • Cloud Infrastructure
    • CI/CD Pipelines
    • Docker
    • Kubernates
    • Infrastructure as Code
Powered by GitBook
On this page
  1. Features
  2. Caching
  3. API

InMemoryCacheOptions

In-Memory cache options

/// <summary>
/// In-Memory cache options
/// </summary>
public class InMemoryCacheOptions
{
    /// <summary>
    /// Sets system clock
    /// </summary>
    public ISystemClock Clock { get; set; }

    /// <summary>
    /// Gets or sets the minimum length of time between successive scans for expired items.
    /// Default value is 60 seconds
    /// </summary>
    public int ExpirationScanFrequencyInSeconds{ get; set; } = 60;

    /// <summary>
    /// Gets or sets the maximum size of the cache.
    /// Default value is null.
    /// </summary>
    public ulong? SizeLimit { get; set; }

    /// <summary>
    /// Gets or sets the amount to compact the cache by when the maximum size is exceeded.
    /// Value must be between 0 and 1.
    /// Default value is 0.05
    /// </summary>
    public double CompactionPercentage { get; set; }

    /// <summary>
    /// Gets or sets whether to track memory cache statistics.
    /// Disabled by default (false).
    /// </summary>
    public bool TrackStatistics { get; set; }

    /// <summary>
    /// Gets or sets whether to track linked entries.
    /// Disabled by default (false).
    /// </summary>
    /// <remarks>Prior to .NET 7 this feature was always enabled.</remarks>
    public bool TrackLinkedCacheEntries { get; set; }
}
PreviousCacheSourceNextRedisCacheOptions

Last updated 1 year ago