Expand description
Media-content-aware caching.
Standard eviction policies treat all entries equally. For multimedia workloads, different content types have very different access patterns and cost/benefit trade-offs:
- Manifests are tiny but highly re-fetched → very high priority, short TTL.
- Video segments are large and often sequential → medium priority, long TTL.
- Thumbnails are small and rarely re-fetched but cheap → very long TTL.
ContentAwareCache layers this domain knowledge on top of
LruCache so that eviction candidates are
scored by a combined recency × priority × size-efficiency metric rather
than pure LRU order.
Structs§
- Cache
Entry - A single entry held in
ContentAwareCache. - Content
Aware Cache - A media-content-aware cache that scores eviction candidates by a recency × priority × size metric rather than pure LRU order.
- Content
Cache Priority - Numeric priority (higher = more important to keep in cache).
Enums§
- Media
Content Type - The media type of a cached entry.
Functions§
- ttl_
for_ type - Return the recommended TTL for the given content type.