Skip to content

//okhttp/okhttp3/CacheControl/Builder/maxStale

maxStale

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

Accept cached responses that have exceeded their freshness lifetime by up to maxStale. If unspecified, stale cache responses will not be used.

Parameters

jvm

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

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

Accept cached responses that have exceeded their freshness lifetime by up to maxStale. If unspecified, stale cache responses will not be used.

Parameters

common

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

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