Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for onlyIfCached (0.09 sec)

  1. 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, " +
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  2. 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
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:41:01 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/CacheControl.kt

      @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",
        replaceWith = ReplaceWith(expression = "noTransform"),
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:41:01 UTC 2024
    - 10K bytes
    - Viewed (0)
  4. 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()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:41:01 UTC 2024
    - 2.7K 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()
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Oct 31 09:27:31 UTC 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())
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  7. 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. */
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:24:48 UTC 2024
    - 12K bytes
    - Viewed (0)
  8. 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
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
  9. 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) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  10. okhttp/api/okhttp.api

    	public final fun minFreshSeconds ()I
    	public final fun mustRevalidate ()Z
    	public final fun noCache ()Z
    	public final fun noStore ()Z
    	public final fun noTransform ()Z
    	public final fun onlyIfCached ()Z
    	public static final fun parse (Lokhttp3/Headers;)Lokhttp3/CacheControl;
    	public final fun sMaxAgeSeconds ()I
    	public fun toString ()Ljava/lang/String;
    }
    
    public final class okhttp3/CacheControl$Builder {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:41:01 UTC 2024
    - 70.2K bytes
    - Viewed (0)
Back to top