perf: identity lookups — HTTP/2 and a handle answer cache #197

Closed
opened 2026-10-05 02:19:52 +00:00 by Grandiras · 0 comments
Owner

Problem

Identity lookups are slower than they need to be:

  • Every fetch goes out over HTTP/1.1, so a burst of concurrent lookups against one host (the PLC directory, the DNS-over-HTTPS endpoint) opens a connection per request. Measured on the live network, 88 concurrent PLC lookups take ~550 ms p50.
  • Handle answers are never remembered. IdentityResolver re-verifies the claimed handle on every resolution of a DID, even when the DID document is cached, so each call costs a well-known/DoH round trip (~120 ms p50 warm).

Proposal

  • Send identity fetches as HTTP/2 with fallback to 1.1 (RequestVersionOrLower). The same burst drops to ~335 ms p50.
  • Remember a handle's resolved DID for IdentityResolverOptions.HandleCacheTtl (default 5 min; zero disables), as the handle spec recommends. Only answers are cached, never "no answer" or conflicts. ResolveUncachedAsync bypasses the cache.
### Problem Identity lookups are slower than they need to be: - Every fetch goes out over HTTP/1.1, so a burst of concurrent lookups against one host (the PLC directory, the DNS-over-HTTPS endpoint) opens a connection per request. Measured on the live network, 88 concurrent PLC lookups take ~550 ms p50. - Handle answers are never remembered. `IdentityResolver` re-verifies the claimed handle on every resolution of a DID, even when the DID document is cached, so each call costs a well-known/DoH round trip (~120 ms p50 warm). ### Proposal - Send identity fetches as HTTP/2 with fallback to 1.1 (`RequestVersionOrLower`). The same burst drops to ~335 ms p50. - Remember a handle's resolved DID for `IdentityResolverOptions.HandleCacheTtl` (default 5 min; zero disables), as the handle spec recommends. Only answers are cached, never "no answer" or conflicts. `ResolveUncachedAsync` bypasses the cache.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Grandiras/ATProto.NET#197
No description provided.