Skip to main content

Module content_routing_cache

Module content_routing_cache 

Source
Expand description

Content Routing Cache — multi-tier DHT routing cache.

Stores provider records, routing hints, and negative cache entries to reduce DHT lookup latency. Organises data into three independent tiers with configurable per-tier TTLs, per-CID provider limits, and global capacity caps with oldest-CID eviction.

Structs§

CacheConfig
Configuration for ContentRoutingCache.
CacheStats
Snapshot of cache statistics.
ContentRoutingCache
Multi-tier cache for DHT content routing.
CrcProviderRecord
A single provider record: which peer provides a given CID.
NegativeCacheEntry
Negative-cache entry: CID was looked up and not found.
RoutingHint
Cached routing hint: the nearest peers known for a CID.

Constants§

DEFAULT_HINT_TTL_MS
Default routing-hint TTL: 5 minutes in milliseconds.
DEFAULT_MAX_HINTS
Default routing-hint cache capacity (number of distinct CIDs).
DEFAULT_MAX_NEGATIVE
Default negative cache capacity (number of distinct CIDs).
DEFAULT_MAX_PROVIDERS
Default provider cache capacity (number of distinct CIDs).
DEFAULT_NEGATIVE_TTL_MS
Default negative-entry TTL: 1 minute in milliseconds.
DEFAULT_PROVIDER_TTL_MS
Default provider record TTL: 1 hour in milliseconds.