CacheStorage

This CDP domain is experimental.

Types

Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.

class cdp.cache_storage.CacheId

Unique identifier of the Cache object.

class cdp.cache_storage.CachedResponseType

type of HTTP response cached

BASIC = 'basic'
CORS = 'cors'
DEFAULT = 'default'
ERROR = 'error'
OPAQUE_REDIRECT = 'opaqueRedirect'
OPAQUE_RESPONSE = 'opaqueResponse'
class cdp.cache_storage.DataEntry(request_url, request_method, request_headers, response_time, response_status, response_status_text, response_type, response_headers)

Data entry.

request_headers = None

Request headers

request_method = None

Request method.

request_url = None

Request URL.

response_headers = None

Response headers

response_status = None

HTTP response status code.

response_status_text = None

HTTP response status text.

response_time = None

Number of seconds since epoch.

response_type = None

HTTP response type

class cdp.cache_storage.Cache(cache_id, security_origin, cache_name)

Cache identifier.

cache_id = None

An opaque unique id of the cache.

cache_name = None

The name of the cache.

security_origin = None

Security origin of the cache.

class cdp.cache_storage.Header(name, value)
class cdp.cache_storage.CachedResponse(body)

Cached response

body = None

Entry content, base64-encoded.

Commands

Each command is a generator function. The return type Generator[x, y, z] indicates that the generator yields arguments of type x, it must be resumed with an argument of type y, and it returns type z. In this library, types x and y are the same for all commands, and z is the return type you should pay attention to. For more information, see Getting Started: Commands.

cdp.cache_storage.delete_cache(cache_id)

Deletes a cache.

Parameters:cache_id (CacheId) – Id of cache for deletion.
Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.cache_storage.delete_entry(cache_id, request)

Deletes a cache entry.

Parameters:
  • cache_id (CacheId) – Id of cache where the entry will be deleted.
  • request (str) – URL spec of the request.
Return type:

Generator[Dict[str, Any], Dict[str, Any], None]

cdp.cache_storage.request_cache_names(security_origin)

Requests cache names.

Parameters:security_origin (str) – Security origin.
Return type:Generator[Dict[str, Any], Dict[str, Any], List[Cache]]
Returns:Caches for the security origin.
cdp.cache_storage.request_cached_response(cache_id, request_url, request_headers)

Fetches cache entry.

Parameters:
  • cache_id (CacheId) – Id of cache that contains the entry.
  • request_url (str) – URL spec of the request.
  • request_headers (List[Header]) – headers of the request.
Return type:

Generator[Dict[str, Any], Dict[str, Any], CachedResponse]

Returns:

Response read from the cache.

cdp.cache_storage.request_entries(cache_id, skip_count, page_size, path_filter=None)

Requests data from cache.

Parameters:
  • cache_id (CacheId) – ID of cache to get entries from.
  • skip_count (int) – Number of records to skip.
  • page_size (int) – Number of records to fetch.
  • path_filter (Optional[str]) – (Optional) If present, only return the entries containing this substring in the path
Return type:

Generator[Dict[str, Any], Dict[str, Any], Tuple[List[DataEntry], float]]

Returns:

A tuple with the following items:

  1. cacheDataEntries - Array of object store data entries.
  2. returnCount - Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage.

Events

There are no events in this module.