我使用以下客户端
private val client: HttpClient by lazy {
HttpClient(OkHttp) {
engine {
config {
cache(Cache(File(App.context.cacheDir, "ktor"), 10 * 1024 * 1024))
}
}
install(ContentNegotiation) {
json(jsonSerializer)
}
expectSuccess = true
}
}
...
val response = client.get("https://stuff.com/data")
是否可以检测
response
是否来自okhttp缓存?
我能以某种方式获取 okhttp 响应对象并检查是否
okhttpResponse.networkResponse() == null
吗?