NetworkCacheInterceptor

class NetworkCacheInterceptor(maxAge: Int = 1, timeUnit: TimeUnit = TimeUnit.MINUTES, cacheControlAbbreviation: String = "Cache-control") : Interceptor

In order to cache the response build cache see @see Context.retrofitCache()

OkHttpClient.Builder().cache(cache).addNetworkInterceptor(networkCacheInterceptor)

Constructors

Link copied to clipboard
constructor(maxAge: Int = 1, timeUnit: TimeUnit = TimeUnit.MINUTES, cacheControlAbbreviation: String = "Cache-control")

Functions

Link copied to clipboard
open override fun intercept(chain: Interceptor.Chain): Response