filesystem¶
Summary¶
|
Backend that stores cached responses as files on the local filesystem. |
|
A dictionary-like interface to files on the local filesystem |
Module Contents¶
- class FileBackend(cache_name='http_cache', use_temp=False, **kwargs)¶
Bases:
aiohttp_client_cache.backends.base.CacheBackend
Backend that stores cached responses as files on the local filesystem. Response paths will be in the format
<cache_name>/responses/<cache_key>
. Redirects are stored in a SQLite database, located at<cache_name>/redirects.sqlite
.
- class FileCache(cache_name, use_temp=False, **kwargs)¶
Bases:
aiohttp_client_cache.backends.base.BaseCache
A dictionary-like interface to files on the local filesystem
- Parameters
use_temp (bool) –
- _abc_impl = <_abc_data object>¶
- _join(key)¶
- _try_io(ignore_errors=True)¶
Attempt an I/O operation, and either ignore errors or re-raise them as KeyErrors
- Parameters
ignore_errors (bool) –
- async bulk_delete(keys)¶
Delete item(s) from the cache. Does not raise an error if the item is missing.
- Parameters
keys (set) –
- async clear()¶
Note: Currently this is a blocking operation
- async delete(key)¶
Delete an item from the cache. Does not raise an error if the item is missing.
- Parameters
key (str) –
- async keys()¶
Get all keys stored in the cache
- Return type
- async paths()¶
Get file paths to all cached responses
- async read(key)¶
Read an item from the cache. Returns
None
if the item is missing.
- async values()¶
Get all values stored in the cache
- Return type