setTimeToLive

abstract fun setTimeToLive(timeToLive: Duration)

Set amount of time that an item can live in the cache. Calling this method will also enable the cache.

Parameters

timeToLive

the time to live value.