Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for cacheConditionalHit (0.23 sec)

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

        response: Response,
      ) {
        logWithTime("cacheHit")
    
        delegate.cacheHit(call, response)
      }
    
      override fun cacheConditionalHit(
        call: Call,
        cachedResponse: Response,
      ) {
        logWithTime("cacheConditionalHit")
    
        delegate.cacheConditionalHit(call, cachedResponse)
      }
    
      private fun logWithTime(message: String) {
        val startNs = startNs
        val timeMs =
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6K bytes
    - Viewed (0)
  2. docs/features/caching.md

     - CallStart 
     - **CacheMiss**
     - ProxySelectStart
     - ... Standard Events ...
     - CallEnd
            
    ### Conditional Cache Hit
     
    When cache flags require checking the cache results are still valid an early cacheConditionalHit event is
    received followed by a cache hit or miss.  Critically in the cache hit scenario the server won’t send the response body.
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 3.1K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingEventListener.kt

      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 Apr 26 11:42:10 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

      ) {
        logWithTime("cacheHit: $response")
      }
    
      override fun cacheMiss(call: Call) {
        logWithTime("cacheMiss")
      }
    
      override fun cacheConditionalHit(
        call: Call,
        cachedResponse: Response,
      ) {
        logWithTime("cacheConditionalHit: $cachedResponse")
      }
    
      private fun logWithTime(message: String) {
        val timeMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 01 11:07:32 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  5. okhttp-logging-interceptor/api/logging-interceptor.api

    	public static final field Companion Lokhttp3/logging/LoggingEventListener$Companion;
    	public synthetic fun <init> (Lokhttp3/logging/HttpLoggingInterceptor$Logger;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
    	public fun cacheConditionalHit (Lokhttp3/Call;Lokhttp3/Response;)V
    	public fun cacheHit (Lokhttp3/Call;Lokhttp3/Response;)V
    	public fun cacheMiss (Lokhttp3/Call;)V
    	public fun callEnd (Lokhttp3/Call;)V
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 4.5K bytes
    - Viewed (1)
  6. okhttp-logging-interceptor/src/test/java/okhttp3/logging/LoggingEventListenerTest.kt

            .build()
        val listener = loggingEventListenerFactory.create(call)
        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\}"""))
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  7. okhttp-testing-support/src/main/kotlin/okhttp3/CallEvent.kt

        override val call: Call,
      ) : CallEvent()
    
      data class CacheMiss(
        override val timestampNs: Long,
        override val call: Call,
      ) : CallEvent()
    
      data class CacheConditionalHit(
        override val timestampNs: Long,
        override val call: Call,
      ) : CallEvent()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

            .cacheResponse(cacheResponse.stripBody())
            .build().also {
              listener.cacheHit(call, it)
            }
        }
    
        if (cacheResponse != null) {
          listener.cacheConditionalHit(call, cacheResponse)
        } else if (cache != null) {
          listener.cacheMiss(call)
        }
    
        var networkResponse: Response? = null
        try {
          networkResponse = chain.proceed(networkRequest)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/EventListener.kt

       * Response is available.
       *
       * This event will only be received when a Cache is configured for the client.
       */
      open fun cacheConditionalHit(
        call: Call,
        cachedResponse: Response,
      ) {
      }
    
      fun interface Factory {
        /**
         * Creates an instance of the [EventListener] for a particular [Call]. The returned
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15.2K bytes
    - Viewed (0)
  10. docs/changelogs/changelog_4x.md

        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 Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
Back to top