Cache.this

this(Duration defaultTtl = dur!"seconds"(1), size_t maxSize = 0) @safe

Creates a new cache with the specified default TTL.

Parameters

defaultTtlDefault time-to-live for cache entries
maxSizeMaximum number of entries (0 = unlimited)
this(CacheConfig cfg) @safe

Creates a new cache with the specified configuration.

Parameters

cfgCache configuration options