cache_storage
Cache
dataclass
Cache identifier.
Source code in zendriver/cdp/cache_storage.py
cache_id: CacheId
instance-attribute
cache_name: str
instance-attribute
security_origin: str
instance-attribute
storage_bucket: typing.Optional[storage.StorageBucket] = None
class-attribute
instance-attribute
storage_key: str
instance-attribute
__init__(cache_id, security_origin, storage_key, cache_name, storage_bucket=None)
from_json(json)
classmethod
Source code in zendriver/cdp/cache_storage.py
to_json()
Source code in zendriver/cdp/cache_storage.py
CacheId
Bases: str
Unique identifier of the Cache object.
Source code in zendriver/cdp/cache_storage.py
__repr__()
from_json(json)
classmethod
CachedResponse
dataclass
Cached response
Source code in zendriver/cdp/cache_storage.py
body: str
instance-attribute
__init__(body)
from_json(json)
classmethod
CachedResponseType
Bases: Enum
type of HTTP response cached
Source code in zendriver/cdp/cache_storage.py
BASIC = 'basic'
class-attribute
instance-attribute
CORS = 'cors'
class-attribute
instance-attribute
DEFAULT = 'default'
class-attribute
instance-attribute
ERROR = 'error'
class-attribute
instance-attribute
OPAQUE_REDIRECT = 'opaqueRedirect'
class-attribute
instance-attribute
OPAQUE_RESPONSE = 'opaqueResponse'
class-attribute
instance-attribute
from_json(json)
classmethod
DataEntry
dataclass
Data entry.
Source code in zendriver/cdp/cache_storage.py
request_headers: typing.List[Header]
instance-attribute
request_method: str
instance-attribute
request_url: str
instance-attribute
response_headers: typing.List[Header]
instance-attribute
response_status: int
instance-attribute
response_status_text: str
instance-attribute
response_time: float
instance-attribute
response_type: CachedResponseType
instance-attribute
__init__(request_url, request_method, request_headers, response_time, response_status, response_status_text, response_type, response_headers)
from_json(json)
classmethod
Source code in zendriver/cdp/cache_storage.py
to_json()
Source code in zendriver/cdp/cache_storage.py
Header
dataclass
Source code in zendriver/cdp/cache_storage.py
name: str
instance-attribute
value: str
instance-attribute
__init__(name, value)
from_json(json)
classmethod
delete_cache(cache_id)
Deletes a cache.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cache_id
|
CacheId
|
Id of cache for deletion. |
required |
Source code in zendriver/cdp/cache_storage.py
delete_entry(cache_id, request)
Deletes a cache entry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cache_id
|
CacheId
|
Id of cache where the entry will be deleted. |
required |
request
|
str
|
URL spec of the request. |
required |
Source code in zendriver/cdp/cache_storage.py
request_cache_names(security_origin=None, storage_key=None, storage_bucket=None)
Requests cache names.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
security_origin
|
Optional[str]
|
(Optional) At least and at most one of securityOrigin, storageKey, storageBucket must be specified. Security origin. |
None
|
storage_key
|
Optional[str]
|
(Optional) Storage key. |
None
|
storage_bucket
|
Optional[StorageBucket]
|
(Optional) Storage bucket. If not specified, it uses the default bucket. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[Cache]]
|
Caches for the security origin. |
Source code in zendriver/cdp/cache_storage.py
request_cached_response(cache_id, request_url, request_headers)
Fetches cache entry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cache_id
|
CacheId
|
Id of cache that contains the entry. |
required |
request_url
|
str
|
URL spec of the request. |
required |
request_headers
|
List[Header]
|
headers of the request. |
required |
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CachedResponse]
|
Response read from the cache. |
Source code in zendriver/cdp/cache_storage.py
request_entries(cache_id, skip_count=None, page_size=None, path_filter=None)
Requests data from cache.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cache_id
|
CacheId
|
ID of cache to get entries from. |
required |
skip_count
|
Optional[int]
|
(Optional) Number of records to skip. |
None
|
page_size
|
Optional[int]
|
(Optional) Number of records to fetch. |
None
|
path_filter
|
Optional[str]
|
(Optional) If present, only return the entries containing this substring in the path |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[List[DataEntry], float]]
|
A tuple with the following items: 0. cacheDataEntries - Array of object store data entries. 1. returnCount - Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage. |