- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 10 for cacheResponse (0.1 seconds)
-
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache/CacheInterceptor.kt
if (networkRequest == null) { return cacheResponse!! .newBuilder() .cacheResponse(cacheResponse.stripBody()) .build() .also { chain.eventListener.cacheHit(call, it) } } if (cacheResponse != null) { chain.eventListener.cacheConditionalHit(call, cacheResponse) } else if (cache != null) { chain.eventListener.cacheMiss(call)
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Jan 11 12:06:21 GMT 2026 - 10.3K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Response.kt
checkSupportResponse("networkResponse", networkResponse) this.networkResponse = networkResponse } open fun cacheResponse(cacheResponse: Response?) = apply { checkSupportResponse("cacheResponse", cacheResponse) this.cacheResponse = cacheResponse } private fun checkSupportResponse( name: String, response: Response?, ) { response?.apply {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Mon Jul 28 14:39:28 GMT 2025 - 18.1K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache/CacheStrategy.kt
*/ private fun isFreshnessLifetimeHeuristic(): Boolean = cacheResponse!!.cacheControl.maxAgeSeconds == -1 && expires == null init { if (cacheResponse != null) { this.sentRequestMillis = cacheResponse.sentRequestAtMillis this.receivedResponseMillis = cacheResponse.receivedResponseAtMillis val headers = cacheResponse.headers for (i in 0 until headers.size) {Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Jan 27 09:00:39 GMT 2026 - 12.1K bytes - Click Count (0) -
docs/recipes.md
[CacheResponseJava]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/CacheResponse.java [CacheResponseKotlin]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/kt/CacheResponse.kt [CancelCallJava]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/CancelCall.java
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Mar 15 09:01:42 GMT 2026 - 47.8K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/KotlinDeprecationErrorTest.kt
val headers: Headers = response.headers() val body: ResponseBody = response.body() val networkResponse: Response? = response.networkResponse() val cacheResponse: Response? = response.cacheResponse() val priorResponse: Response? = response.priorResponse() val cacheControl: CacheControl = response.cacheControl() val sentRequestAtMillis: Long = response.sentRequestAtMillis()
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Dec 27 13:39:56 GMT 2024 - 13.3K bytes - Click Count (0) -
docs/changelogs/upgrading_to_okhttp_4.md
* **PushPromise**: headers, method, path, response * **Request**: body, cacheControl, headers, method, url * **Response**: body, cacheControl, cacheResponse, code, handshake, headers, message, networkResponse, priorResponse, protocol, receivedResponseAtMillis, request, sentRequestAtMillis * **Route**: address, proxy, socketAddress * **TlsVersion**: javaName
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Feb 06 16:58:16 GMT 2022 - 10.9K bytes - Click Count (0) -
android-test/src/androidDeviceTest/java/okhttp/android/test/OkHttpTest.kt
assertNull(it.cacheResponse) assertNotNull(it.networkResponse) assertEquals(3, it.cacheControl.maxAgeSeconds) assertTrue(it.cacheControl.isPublic) } client .newCall(request) .execute() .use { assertEquals(200, it.code) assertNotNull(it.cacheResponse) assertNull(it.networkResponse)
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Jan 27 09:00:39 GMT 2026 - 29.9K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Cache.kt
/** * Returns true if none of the Vary headers have changed between [cachedRequest] and * [newRequest]. */ fun varyMatches( cachedResponse: Response, cachedRequest: Headers, newRequest: Request, ): Boolean = cachedResponse.headers.varyFields().none { cachedRequest.values(it) != newRequest.headers(it) }Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Mar 20 09:13:37 GMT 2026 - 26.9K bytes - Click Count (0) -
CHANGELOG.md
) ``` * New: `Response.body` is now non-null. This was generally the case in OkHttp 4.x, but the Kotlin type declaration was nullable to support rare cases like the body on `Response.cacheResponse`, `Response.networkResponse`, and `Response.priorResponse`. In such cases the body is now non-null, but attempts to read its content will fail.Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Feb 15 11:57:47 GMT 2026 - 36.2K bytes - Click Count (2) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/EventListener.kt
delegate.cacheMiss(call) } } override fun cacheConditionalHit( call: Call, cachedResponse: Response, ) { for (delegate in eventListeners) { delegate.cacheConditionalHit(call, cachedResponse) } } override fun retryDecision( call: Call, exception: IOException, retry: Boolean, ) {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Oct 07 21:03:04 GMT 2025 - 24.9K bytes - Click Count (0)