Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for cacheResponse (0.19 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

        // If we don't need the network, we're done.
        if (networkRequest == null) {
          return cacheResponse!!.newBuilder()
            .cacheResponse(cacheResponse.stripBody())
            .build().also {
              listener.cacheHit(call, it)
            }
        }
    
        if (cacheResponse != null) {
          listener.cacheConditionalHit(call, cacheResponse)
        } else if (cache != null) {
          listener.cacheMiss(call)
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheStrategy.kt

        private fun isFreshnessLifetimeHeuristic(): Boolean {
          return 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) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Response.kt

      )
      fun networkResponse(): Response? = networkResponse
    
      @JvmName("-deprecated_cacheResponse")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "cacheResponse"),
        level = DeprecationLevel.ERROR,
      )
      fun cacheResponse(): Response? = cacheResponse
    
      @JvmName("-deprecated_priorResponse")
      @Deprecated(
        message = "moved to val",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 15.5K bytes
    - Viewed (0)
  4. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt

                .cacheControl(onlyIfCached)
                .cacheUrlOverride(cacheUrl)
                .build()
    
            val cacheResponse = client.newCall(cacheRequest).execute()
    
            if (cacheResponse.code != HttpURLConnection.HTTP_GATEWAY_TIMEOUT) {
              return cacheResponse
            }
          } catch (ioe: IOException) {
            // Failures are ignored as we can fallback to the network
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  5. 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
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
  6. okhttp/src/test/java/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()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.3K bytes
    - Viewed (0)
  7. okhttp/src/test/java/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
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  8. android-test/src/androidTest/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)
            }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 27K bytes
    - Viewed (1)
  9. 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
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 16:58:16 GMT 2022
    - 10.9K bytes
    - Viewed (0)
  10. okhttp/src/main/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 {
          return cachedResponse.headers.varyFields().none {
            cachedRequest.values(it) != newRequest.headers(it)
          }
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
Back to top