Caching Configuration
The Persistence Layer offers a lot of settings and the database connection configuration. This page covers the more general settings. The specific database configurations are covered on their respective page.
Configuration Path
Section titled “Configuration Path”HAKOM:Persistence:CachingConfiguration Structure
Section titled “Configuration Structure”Caching└─ GlobalOptions ├─ CompactionPercentage ├─ ExpirationScanFrequency ├─ SizeLimit ├─ TrackStatistics └─ TrackLinkedCacheEntriesQuick Start
Section titled “Quick Start”<HAKOM> <Persistence> <Caching> <GlobalOptions> <CompactionPercentage>0.2</CompactionPercentage> <ExpirationScanFrequency>00:05:00</ExpirationScanFrequency> <SizeLimit>1000</SizeLimit> <TrackStatistics>false</TrackStatistics> <TrackLinkedCacheEntries>false</TrackLinkedCacheEntries> </GlobalOptions> </Caching> </Persistence></HAKOM>{ "Persistence": { "Caching": { "GlobalOptions": { "CompactionPercentage": 0.2, "ExpirationScanFrequency": "00:05:00", "SizeLimit": 1000, "TrackStatistics": false, "TrackLinkedCacheEntries": false } } }}HAKOM__Persistence__Caching__GlobalOptions__CompactionPercentage=0.2HAKOM__Persistence__Caching__GlobalOptions__ExpirationScanFrequency=00:05:00HAKOM__Persistence__Caching__GlobalOptions__SizeLimit=1000HAKOM__Persistence__Caching__GlobalOptions__TrackStatistics=falseHAKOM__Persistence__Caching__GlobalOptions__TrackLinkedCacheEntries=falseConfiguration Elements
Section titled “Configuration Elements”Global Options
Section titled “Global Options”Caching in the Persistence Layer is based on Microsoft.Extensions.Caching.Memory.MemoryCacheOptions. For advanced details, refer to the official documentation.
Path: HAKOM:Persistence:Caching:GlobalOptions
| Element | Type | Default | Required | Description |
|---|---|---|---|---|
CompactionPercentage |
double |
0.05 |
Configures the amount by which the cache is compacted when the maximum size is exceeded. Allowed values: any double between 0 and 1. |
|
ExpirationScanFrequency |
TimeSpan |
00:01:00 |
Configures the interval in which it will scan for expired data. Allowed values: any TimeSpan in the format hh:mm:ss. |
|
SizeLimit |
long |
— | Configures the maximum size of the cache. Allowed values: any long value, or null for no limit. Not set by default (no limit). |
|
TrackStatistics |
bool |
false |
Enables tracking of cache statistics. | |
TrackLinkedCacheEntries |
bool |
false |
Enables tracking of linked cache entries. |
Was this page helpful?Thanks for your feedback!