CachePolicy

fun CachePolicy(ttl: Duration, configure: CachePolicy.Builder.() -> Unit = {}): CachePolicy(source)

Builds a CachePolicy.

Stable Core. CachePolicy(10.minutes) { missTtl = 30.seconds }; without the lambda, missTtl is CachePolicy.DEFAULT_MISS_TTL.

Return

the policy.

Parameters

ttl

how long a value is stored; not negative; zero stores nothing.

configure

assigns the optional properties.

Throws

if ttl or the configured missTtl is negative; the message names the property and never a value.