retrofitCache
fun Context.retrofitCache(cacheDirName: String = "http-cache", cacheSize: Int = 10 * 1024 * 1024): Cache
Use as OkHttpClient.Builder().cache(cache)
Receiver
Context needed for obtaining the cachedir
Return
Cache
Parameters
cacheDirName
String initial is "http-cache"
cacheSize
Int initial is 10 * 1024 * 1024 // 10 MB