- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 23 for cacheResponse (0.08 seconds)
-
samples/guide/src/main/java/okhttp3/recipes/kt/CacheResponse.kt
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Mar 19 19:25:20 GMT 2025 - 2K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/RecordedResponse.kt
fun assertNoCacheResponse() = apply { assertThat(response!!.cacheResponse).isNull() } /** * Asserts that the current response used the cache and returns the cache response. */ fun cacheResponse(): RecordedResponse { val cacheResponse = response!!.cacheResponse!! return RecordedResponse(cacheResponse.request, cacheResponse, null, null, null) }
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Dec 27 13:39:56 GMT 2024 - 5.3K bytes - Click Count (0) -
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/features/caching.md
received followed by a cache hit or miss. Critically in the cache hit scenario the server won’t send the response body. The response will have non-null `cacheResponse` and `networkResponse`. The cacheResponse will be used as the top level response only if the response code is HTTP/1.1 304 Not Modified. - CallStart - **CacheConditionalHit** - ConnectionAcquired - ... Standard Events...
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Mar 15 09:01:42 GMT 2026 - 3.1K bytes - Click Count (1) -
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) -
okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt
val builder: Response.Builder = response.newBuilder() val redirect: Boolean = response.isRedirect val networkResponse: Response? = response.networkResponse val cacheResponse: Response? = response.cacheResponse val priorResponse: Response? = response.priorResponse val challenges: List<Challenge> = response.challenges() val cacheControl: CacheControl = response.cacheControl
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Mar 10 21:47:20 GMT 2026 - 49.7K bytes - Click Count (0) -
okhttp/api/jvm/okhttp.api
public final fun -deprecated_sentRequestAtMillis ()J public final fun body ()Lokhttp3/ResponseBody; public final fun cacheControl ()Lokhttp3/CacheControl; public final fun cacheResponse ()Lokhttp3/Response; public final fun challenges ()Ljava/util/List; public fun close ()V public final fun code ()I public final fun handshake ()Lokhttp3/Handshake;
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Mar 10 21:47:20 GMT 2026 - 72.3K bytes - Click Count (0)