From 95a34271150589020dcd14ea6742f2eba601648d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 May 2026 16:16:18 +0000 Subject: [PATCH] chore(okhttp): bump AmethystDns cache to 2000 entries A Nostr feed can touch hundreds of distinct hosts (Blossom servers, relays, NIP-05 domains, image proxies). The 256-entry cap was small enough that active users would churn the LRU and pay extra getaddrinfo calls. 2000 still costs <100KB of heap. --- .../com/vitorpamplona/amethyst/service/okhttp/AmethystDns.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/AmethystDns.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/AmethystDns.kt index a453864a5..1e044ff4d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/AmethystDns.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/okhttp/AmethystDns.kt @@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit */ class AmethystDns( private val delegate: Dns = Dns.SYSTEM, - private val maxEntries: Int = 256, + private val maxEntries: Int = 2000, positiveTtlMs: Long = TimeUnit.MINUTES.toMillis(5), negativeTtlMs: Long = TimeUnit.SECONDS.toMillis(10), ) : Dns {