Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for onlyIfCached (0.25 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/-CacheControlCommon.kt

        sMaxAgeSeconds = -1,
        isPrivate = false,
        isPublic = false,
        mustRevalidate = false,
        maxStaleSeconds = maxStaleSeconds,
        minFreshSeconds = minFreshSeconds,
        onlyIfCached = onlyIfCached,
        noTransform = noTransform,
        immutable = immutable,
        headerValue = null,
      )
    }
    
    internal fun CacheControl.Builder.commonNoCache() =
      apply {
        this.noCache = true
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/CacheControlTest.kt

        assertThat(cacheControl.onlyIfCached).isFalse()
        assertThat(cacheControl.mustRevalidate).isFalse()
      }
    
      @Test
      @Throws(Exception::class)
      fun completeBuilder() {
        val cacheControl =
          CacheControl.Builder()
            .noCache()
            .noStore()
            .maxAge(1.seconds)
            .maxStale(2.seconds)
            .minFresh(3.seconds)
            .onlyIfCached()
            .noTransform()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/CacheControl.kt

        level = DeprecationLevel.ERROR,
      )
      fun minFreshSeconds(): Int = minFreshSeconds
    
      @JvmName("-deprecated_onlyIfCached")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "onlyIfCached"),
        level = DeprecationLevel.ERROR,
      )
      fun onlyIfCached(): Boolean = onlyIfCached
    
      @JvmName("-deprecated_noTransform")
      @Deprecated(
        message = "moved to val",
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 10K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/CacheControlJvmTest.kt

        val cacheControl =
          CacheControl.Builder()
            .noCache()
            .noStore()
            .maxAge(1, TimeUnit.SECONDS)
            .maxStale(2, TimeUnit.SECONDS)
            .minFresh(3, TimeUnit.SECONDS)
            .onlyIfCached()
            .noTransform()
            .immutable()
            .build()
        assertThat(cacheControl.toString()).isEqualTo(
          "no-cache, no-store, max-age=1, max-stale=2, min-fresh=3, only-if-cached, " +
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  5. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt

            // 504 code indicates that the Cache is stale
            val onlyIfCached =
              CacheControl.Builder()
                .onlyIfCached()
                .build()
    
            var cacheUrl = request.url
    
            val cacheRequest =
              request.newBuilder()
                .cacheControl(onlyIfCached)
                .cacheUrlOverride(cacheUrl)
                .build()
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

        val mustRevalidate: Boolean = cacheControl.mustRevalidate()
        val maxStaleSeconds: Int = cacheControl.maxStaleSeconds()
        val minFreshSeconds: Int = cacheControl.minFreshSeconds()
        val onlyIfCached: Boolean = cacheControl.onlyIfCached()
        val noTransform: Boolean = cacheControl.noTransform()
        val immutable: Boolean = cacheControl.immutable()
        val parse: CacheControl = CacheControl.parse(Headers.of())
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 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 mustRevalidate: Boolean = cacheControl.mustRevalidate
        val maxStaleSeconds: Int = cacheControl.maxStaleSeconds
        val minFreshSeconds: Int = cacheControl.minFreshSeconds
        val onlyIfCached: Boolean = cacheControl.onlyIfCached
        val noTransform: Boolean = cacheControl.noTransform
        val immutable: Boolean = cacheControl.immutable
        val forceCache: CacheControl = CacheControl.FORCE_CACHE
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  8. docs/changelogs/upgrading_to_okhttp_4.md

       proxyAuthenticator, proxySelector, socketFactory, sslSocketFactory, url
     * **Cache**: directory
     * **CacheControl**: immutable, maxAgeSeconds, maxStaleSeconds, minFreshSeconds, mustRevalidate,
       noCache, noStore, noTransform, onlyIfCached, sMaxAgeSeconds
     * **Challenge**: authParams, charset, realm, scheme
     * **CipherSuite**: javaName
     * **ConnectionSpec**: cipherSuites, supportsTlsExtensions, tlsVersions
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Feb 06 16:58:16 GMT 2022
    - 10.9K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheStrategy.kt

        fun compute(): CacheStrategy {
          val candidate = computeCandidate()
    
          // We're forbidden from using the network and the cache is insufficient.
          if (candidate.networkRequest != null && request.cacheControl.onlyIfCached) {
            return CacheStrategy(null, null)
          }
    
          return candidate
        }
    
        /** Returns a strategy to use assuming the request can use the network. */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/Cache.kt

     * directive:
     *
     * ```java
     * Request request = new Request.Builder()
     *     .cacheControl(new CacheControl.Builder()
     *         .onlyIfCached()
     *         .build())
     *     .url("http://publicobject.com/helloworld.txt")
     *     .build();
     * Response forceCacheResponse = client.newCall(request).execute();
     * if (forceCacheResponse.code() != 504) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
Back to top