Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for cache (0.25 sec)

  1. 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)
  2. mockwebserver/README.md

    add headers with a fluent builder API.
    
    ```java
    MockResponse response = new MockResponse()
        .addHeader("Content-Type", "application/json; charset=utf-8")
        .addHeader("Cache-Control", "no-cache")
        .setBody("{}");
    ```
    
    MockResponse can be used to simulate a slow network. This is useful for
    testing timeouts and interactive testing.
    
    ```java
    response.throttleBody(1024, 1, TimeUnit.SECONDS);
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  3. okhttp/src/test/java/okhttp3/CacheControlJvmTest.kt

      }
    
      @Test
      @Throws(Exception::class)
      fun parse() {
        val header = (
          "no-cache, no-store, max-age=1, s-maxage=2, private, public, must-revalidate, " +
            "max-stale=3, min-fresh=4, only-if-cached, no-transform"
        )
        val cacheControl =
          parse(
            Headers.Builder()
              .set("Cache-Control", header)
              .build(),
          )
        assertThat(cacheControl.noCache).isTrue()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  4. docs/features/caching.md

     - ConnectionReleased
     - CallEnd
     
    ## Cache directory
    
    The cache directory must be exclusively owned by a single instance.
    
    Deleting the cache when it is no longer needed can be done.  However this may delete the purpose of the cache
    which is designed to persist between app restarts.
    
    ```kotlin
    cache.delete()
    ```
     
    ## Pruning the Cache
    
    Pruning the entire Cache to clear space temporarily can be done using evictAll.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 3.1K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt

        cache = buildCache("/cache/".toPath(), Int.MAX_VALUE.toLong(), loggingFileSystem)
        client =
          clientTestRule.newClientBuilder()
            .cache(cache)
            .cookieJar(JavaNetCookieJar(cookieManager))
            .build()
      }
    
      @AfterEach
      fun tearDown() {
        ResponseCache.setDefault(null)
        if (this::cache.isInitialized) {
          cache.delete()
        }
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (1)
  6. okhttp/src/main/kotlin/okhttp3/internal/-CacheControlCommon.kt

        when {
          name.equals("Cache-Control", ignoreCase = true) -> {
            if (headerValue != null) {
              // Multiple cache-control headers means we can't use the raw value.
              canUseHeaderValue = false
            } else {
              headerValue = value
            }
          }
          name.equals("Pragma", ignoreCase = true) -> {
            // Might specify additional cache-control params. We invalidate just in case.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/CacheResponse.kt

     */
    package okhttp3.recipes.kt
    
    import java.io.File
    import java.io.IOException
    import okhttp3.Cache
    import okhttp3.OkHttpClient
    import okhttp3.Request
    
    class CacheResponse(cacheDirectory: File) {
      private val client: OkHttpClient =
        OkHttpClient.Builder()
          .cache(
            Cache(
              directory = cacheDirectory,
              // 1 MiB.
              maxSize = 10L * 1024L * 1024L,
            ),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2K bytes
    - Viewed (2)
  8. okhttp-android/src/test/kotlin/okhttp3/android/RobolectricOkHttpClientTest.kt

      private lateinit var client: OkHttpClient
    
      @Before
      fun setUp() {
        context = ApplicationProvider.getApplicationContext<Application>()
        client =
          OkHttpClient.Builder()
            .cache(Cache(FakeFileSystem(), "/cache".toPath(), 10_000_000))
            .build()
      }
    
      @Test
      fun testRequestExternal() {
        assumeNetwork()
    
        val request = Request("https://www.google.com/robots.txt".toHttpUrl())
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  9. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/TestDohMain.kt

            client = bootstrapClient,
            http2Only = false,
            workingOnly = false,
            getOnly = false,
          )
        runBatch(dnsProviders, names)
        val dnsCache =
          Cache(
            directory = File("./target/TestDohMain.cache.${System.currentTimeMillis()}"),
            maxSize = 10L * 1024 * 1024,
          )
        println("Bad targets\n***********\n")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  10. docs/changelogs/changelog_1x.md

     * Fix: Persist proper `Content-Encoding` header to cache for GZip responses.
     * Fix: Eliminate rare race condition in SPDY streams that would prevent connection reuse.
     * Fix: Change HTTP date formats to UTC to conform to RFC2616 section 3.3.
     * Fix: Support SPDY header blocks with trailing bytes.
     * Fix: Allow `;` as separator for `Cache-Control` header.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 6.4K bytes
    - Viewed (0)
Back to top