Domain Detective

API Reference

Class

DnsResponseCache

Namespace DnsClientX

Simple in-memory cache for DnsResponse instances. Stores responses together with their expiration times.

Inheritance

  • Object
  • DnsResponseCache

Constructors

DnsResponseCache(System.Nullable{System.TimeSpan} cleanupInterval, System.Int32 cleanupThreshold) #

Initializes a new instance of the DnsResponseCache class.

Parameters

cleanupInterval System.Nullable{System.TimeSpan} required
Interval for automatic cleanup.
cleanupThreshold System.Int32 required
Maximum number of entries before a cleanup is triggered.

Methods

Cleanup() #

Removes expired entries from the cache.

Dispose() #
Set(System.String key, DnsClientX.DnsResponse response, System.TimeSpan ttl) #

Stores a response in the cache using the specified TTL value.

Parameters

key System.String required
Cache key.
response DnsClientX.DnsResponse required
Response to cache.
ttl System.TimeSpan required
Time to keep the entry.

Returns

None.

TryGet(System.String key, DnsClientX.DnsResponse@ response) #

Attempts to retrieve a cached response for a given key.

Parameters

key System.String required
Cache key.
response DnsClientX.DnsResponse@ required
Retrieved response if found and not expired.

Returns

true if a valid entry was found; otherwise false.

{{ include "footer" }}