Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for cacheHit (0.16 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt

      }
    
      override fun cacheMiss(call: Call) {
        logWithTime("cacheMiss")
    
        delegate.cacheMiss(call)
      }
    
      override fun cacheHit(
        call: Call,
        response: Response,
      ) {
        logWithTime("cacheHit")
    
        delegate.cacheHit(call, response)
      }
    
      override fun cacheConditionalHit(
        call: Call,
        cachedResponse: Response,
      ) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6K bytes
    - Viewed (0)
  2. 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)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingEventListener.kt

      ) = logEvent(SatisfactionFailure(System.nanoTime(), call))
    
      override fun cacheMiss(call: Call) = logEvent(CacheMiss(System.nanoTime(), call))
    
      override fun cacheHit(
        call: Call,
        response: Response,
      ) = logEvent(CacheHit(System.nanoTime(), call))
    
      override fun cacheConditionalHit(
        call: Call,
        cachedResponse: Response,
      ) = logEvent(CacheConditionalHit(System.nanoTime(), call))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9K bytes
    - Viewed (1)
  4. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/LoggingEventListener.kt

      override fun satisfactionFailure(
        call: Call,
        response: Response,
      ) {
        logWithTime("satisfactionFailure: $response")
      }
    
      override fun cacheHit(
        call: Call,
        response: Response,
      ) {
        logWithTime("cacheHit: $response")
      }
    
      override fun cacheMiss(call: Call) {
        logWithTime("cacheMiss")
      }
    
      override fun cacheConditionalHit(
        call: Call,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 11:07:32 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/CallTest.kt

        Thread.sleep(10) // Make sure the timestamps are unique.
        val cacheHit =
          executeSynchronously(
            "/",
            "Accept-Language",
            "en-US",
            "Accept-Charset",
            "UTF-8",
          )
    
        // Check the merged response. The request is the application's original request.
        cacheHit.assertCode(200)
          .assertBody("A")
          .assertHeaders(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  6. okhttp-logging-interceptor/src/test/java/okhttp3/logging/LoggingEventListenerTest.kt

        listener.cacheConditionalHit(call, response)
        listener.cacheHit(call, response)
        listener.cacheMiss(call)
        listener.satisfactionFailure(call, response)
        logRecorder
          .assertLogMatch(Regex("""cacheConditionalHit: Response\{protocol=h2, code=200, message=, url=$url\}"""))
          .assertLogMatch(Regex("""cacheHit: Response\{protocol=h2, code=200, message=, url=$url\}"""))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  7. docs/changelogs/changelog_4x.md

            .build()
    
        val client = OkHttpClient.Builder()
            .sslSocketFactory(clientCertificates.sslSocketFactory(), clientCertificates.trustManager)
            .build()
        ```
    
     *  New: Add `cacheHit`, `cacheMiss`, and `cacheConditionalHit()` events to `EventListener`. Use
        these in logs, metrics, and even test cases to confirm your cache headers are configured as
        expected.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/EventListener.kt

       * Response and normal event sequences will not be received.
       *
       * This event will only be received when a Cache is configured for the client.
       */
      open fun cacheHit(
        call: Call,
        response: Response,
      ) {
      }
    
      /**
       * Invoked when a response will be served from the network. The Response will be
       * available from normal event sequences.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15.2K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/EventListenerTest.kt

          .containsExactly("CallStart", "CacheHit", "CallEnd")
      }
    
      private fun enableCache(): Cache? {
        cache = makeCache()
        client = client.newBuilder().cache(cache).build()
        return cache
      }
    
      private fun makeCache(): Cache {
        val cacheDir = File.createTempFile("cache-", ".dir")
        cacheDir.delete()
        return Cache(cacheDir, (1024 * 1024).toLong())
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 56.9K bytes
    - Viewed (0)
  10. okhttp-dnsoverhttps/README.md

    ### Download
    
    ```kotlin
    testImplementation("com.squareup.okhttp3:okhttp-dnsoverhttps:4.12.0")
    ```
    
    ### Usage
    
    ```
      val appCache = Cache(File("cacheDir", "okhttpcache"), 10 * 1024 * 1024)
      val bootstrapClient = OkHttpClient.Builder().cache(appCache).build()
    
      val dns = DnsOverHttps.Builder().client(bootstrapClient)
        .url("https://dns.google/dns-query".toHttpUrl())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 740 bytes
    - Viewed (4)
Back to top