Skip to content

//okhttp/okhttp3/CacheControl/Builder/minFresh

minFresh

[jvm]\ fun minFresh(minFresh: Int, timeUnit: TimeUnit): CacheControl.Builder

Sets the minimum number of seconds that a response will continue to be fresh for. If the response will be stale when minFresh have elapsed, the cached response will not be used and a network request will be made.

Parameters

jvm

minFresh a non-negative integer. This is stored and transmitted with TimeUnit.SECONDS precision; finer precision will be lost.

[common]\ expect fun minFresh(minFresh: Int, timeUnit: DurationUnit): CacheControl.Builder

Sets the minimum number of seconds that a response will continue to be fresh for. If the response will be stale when minFresh have elapsed, the cached response will not be used and a network request will be made.

Parameters

common

minFresh a non-negative integer. This is stored and transmitted with TimeUnit.SECONDS precision; finer precision will be lost.

[jvm]\ actual fun minFresh(minFresh: Int, timeUnit: DurationUnit): CacheControl.Builder