High-performance cache policies and supporting data structures.
Make eviction consider object size and/or miss cost (common in web/CDN caches), not just request count.
Assign each entry a key H (priority). Evict the smallest H.
Common scoring shape (varies by variant):
H = (cost * freq) / size + L
Where:cost: retrieval cost (latency, backend load, $ cost)freq: access frequency (for GDSF-like variants)size: bytesL: an “inflation” value updated to the H of the last evicted item (prevents tiny objects from dominating forever)Typical implementation:
HashMap<K, Entry> for lookupH for victim selectionImplementation choices:
Use when: