Cache#
Downloads are cached by content hash under $BOOKSHELF_CACHE_DIR. Pass a ContentCache as cache= to Bookshelf to move it for one client.
The members below are the promised surface. ContentCache has other public methods, such as fetch and put, which the SDK uses to fill the cache and which may change in any release. The files inside the cache directory are private, so read them only through these calls.
bookshelf.ContentCache #
A small disk cache keyed only by canonical content hash.
bookshelf.CacheSummary dataclass #
CacheSummary(path: Path, entries: int, total_bytes: int, max_bytes: int, oldest_mtime: float | None, newest_mtime: float | None)
A point-in-time description of the cache contents.