Expand description
hyperlane-plugin-cache
64-way sharded bounded cache and HTTP response caching plugin for Hyperlane
with TTL/byte-budget eviction, single-flight stampede coalescing, pluggable
CacheStore traits, and RFC Cache-Control/Age/X-Cache support.
Structs§
- Cache
Config - Configuration for
ShardedMemoryCacheandCachePlugin. - Cache
Plugin - Process-wide
CachePluginsingleton storingCacheConfigand a pluggableCacheStore. - Cache
Request Hook - Opt-in request middleware serving cached
GET/HEADresponses withX-Cache: HITandAge. - Cache
Response Hook - Opt-in response middleware storing eligible
200 OKresponses according toCache-ControlandVary. - Cached
Value - Cached HTTP response or arbitrary byte payload with headers and timestamp metadata.
- Sharded
Memory Cache - High-concurrency 64-way sharded bounded in-memory
CacheStorewith single-flight coalescing.
Constants§
- DEFAULT_
CACHE_ MAX_ BYTES - Default maximum total cached byte budget (64 MiB).
- DEFAULT_
CACHE_ MAX_ ENTRIES - Default maximum cached response count across all shards.
- DEFAULT_
CACHE_ MAX_ ENTRY_ BYTES - Default maximum single response body eligible for HTTP response caching (1 MiB).
- DEFAULT_
CACHE_ TTL_ MS - Default response cache TTL in milliseconds (60 seconds).
- HEADER_
X_ CACHE - Diagnostic header indicating cache lookup outcome (
HIT,MISS, orBYPASS). - X_
CACHE_ BYPASS X-Cachevalue emitted when caching is bypassed by policy or headers.- X_
CACHE_ HIT X-Cachevalue emitted when served directly from cache.- X_
CACHE_ MISS X-Cachevalue emitted when computed by the origin handler.
Traits§
- Cache
Store - Pluggable asynchronous response/data cache store (in-memory, Redis, Memcached, etc.).
Type Aliases§
- Cache
Future - Boxed
Sendfuture returned by asyncCacheStoretrait methods. - Shared
Cache Store - Thread-safe shared reference to a pluggable
CacheStore.