Skip to content

miniproto.media.download.DownloadRangeCache

miniproto.media.download.DownloadRangeCache

Section titled “miniproto.media.download.DownloadRangeCache”
DownloadRangeCache(*, max_bytes: int = DEFAULT_RANGE_CACHE_BYTES) -> None

Async LRU cache that deduplicates exact media-range requests and bounded prefetches.

Parameters:

  • max_bytes (int) – Maximum payload bytes retained by the LRU; defaults to :data:DEFAULT_RANGE_CACHE_BYTES.
Resource Semantics

Cache entries are shared by (key, offset, limit). clear() cancels in-progress owner and background prefetch tasks; callers awaiting them receive their normal task outcome or cancellation.

Initialize an empty bounded cache.

Parameters:

  • max_bytes (int) – Positive aggregate byte capacity for cached payloads.

Raises: