harp_apps.http_cache.storages¶
- class AsyncStorage[source]¶
Bases:
AsyncBaseStorageHARP’s AsyncBaseStorage implementation using blob storage backend.
This implementation adapts hishel 1.0’s Entry-based API to work with HARP’s blob storage system. We store a single entry per cache key, maintaining backward compatibility with existing cached data.
- __init__(storage, ttl=None, check_ttl_every=60)[source]¶
- Parameters:
storage (IBlobStorage)
- async close()[source]¶
Close the storage (required by AsyncBaseStorage interface).
- Return type:
None
- async create_entry(request, response, key, id_=None)[source]¶
Create and store a new cache entry.
- Args:
request: The HTTP request response: The HTTP response key: The cache key id_: Optional UUID for the entry (generated if not provided)
- Returns:
The created Entry
- async get_entries(key)[source]¶
Retrieve all entries for a given cache key.
Note: Our implementation stores only one entry per key, so this returns a list with at most one element.
- Args:
key: The cache key
- Returns:
List of Entry objects (empty if not found, single element if found)
- async remove_entry(id)[source]¶
Remove an entry by its ID.
- Args:
id: The entry UUID
- Parameters:
id (UUID)
- Return type:
None