FileSystemBoeResponseCache Class
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.Boe.dll
- Package
- Bodu.Financial.ExchangeRates.Boe 0.7.1
An IByteCache<TKey> that persists downloaded IADB range responses as files in a cache directory, keyed by the inclusive date range that produced them.
public sealed class FileSystemBoeResponseCache : FileSystemByteCache<(DateOnly StartDate, DateOnly EndDate)>, IByteCache<(DateOnly StartDate, DateOnly EndDate)>
- Inheritance
-
FileSystemBoeResponseCache
- Implements
- Inherited Members
- Extension Methods
Remarks
Each range is stored under a file name derived from its inclusive bounds; the file's last-write time serves as the freshness timestamp. A cached response is treated as stale once it exceeds the supplied refresh interval, forcing a re-download.
The cache is best-effort: any I/O failure while reading is reported as a miss, and any failure while writing is swallowed, so a cache problem never breaks rate retrieval.
Constructors
FileSystemBoeResponseCache(string?, ILogger?)
Initializes a new instance of the FileSystemBoeResponseCache class.
public FileSystemBoeResponseCache(string? directory, ILogger? logger = null)
Parameters
Methods
GetFileName((DateOnly StartDate, DateOnly EndDate))
Derives the cache file name for a key.
protected override string GetFileName((DateOnly StartDate, DateOnly EndDate) key)
Parameters
Returns
- string
The cache file name.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |