CacheStorage🧪
✅️️ Methods
🔨CacheStorage.deleteCache
删除一个缓存。
EN
Deletes a cache.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| cacheId | ✔️ | CacheId | 用于删除的缓存ID。 | ENId of cache for deletion. |
🔨CacheStorage.deleteEntry
删除一个缓存条目。
EN
Deletes a cache entry.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| cacheId | ✔️ | CacheId | 要删除条目的缓存ID。 | ENId of cache where the entry will be deleted. | |
| request | ✔️ | string | 请求的URL规范。 | ENURL spec of the request. |
🔨CacheStorage.requestCachedResponse
获取缓存条目。
EN
Fetches cache entry.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| cacheId | ✔️ | CacheId | 包含条目的缓存ID。 | ENId of cache that contains the entry. | |
| requestURL | ✔️ | string | 请求的URL规范。 | ENURL spec of the request. | |
| requestHeaders | ✔️ | array[Header] | 请求的头部信息。 | ENheaders of the request. |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| response | CachedResponse | 从缓存中读取响应。 | ENResponse read from the cache. |
🔨CacheStorage.requestCacheNames
请求缓存 名称。
EN
Requests cache names.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| securityOrigin | string | 至少且最多必须指定 securityOrigin、storageKey、storageBucket 中的一个。安全来源。 | ENAt least and at most one of securityOrigin, storageKey, storageBucket must be specified. Security origin. | ||
| storageKey | string | 存储键。 | ENStorage key. | ||
| storageBucket | Storage.StorageBucket | 存储桶。如果未指定,则使用默认桶。 | ENStorage bucket. If not specified, it uses the default bucket. |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| caches | array[Cache] | 安全源的缓存。 | ENCaches for the security origin. |
🔨CacheStorage.requestEntries
从缓存中请求数据。
EN
Requests data from cache.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| cacheId | ✔️ | CacheId | 从中获取条目的缓存ID。 | ENID of cache to get entries from. | |
| skipCount | integer | 要跳过的记录数量。 | ENNumber of records to skip. | ||
| pageSize | integer | 要获取的记录数量。 | ENNumber of records to fetch. | ||
| pathFilter | string | 如果存在,仅返回路径中包含此子字符串的条目 | ENIf present, only return the entries containing this substring in the path |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| cacheDataEntries | array[DataEntry] | 对象存储数据条目数组。 | ENArray of object store data entries. |
| returnCount | number | 从此存储返回的条目数量。如果 pathFilter 为空,则表示此存储中所有条目的总数。 | ENCount of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage. |
✅️️ Types
📌CacheStorage.Cache
缓存标识符。
EN
Cache identifier.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| cacheId | ✔️ | CacheId | 缓存的唯一不透明标识符。 | ENAn opaque unique id of the cache. | |
| securityOrigin | ✔️ | string | 缓存的安全来源。 | ENSecurity origin of the cache. | |
| storageKey | ✔️ | string | 缓存存储键。 | ENStorage key of the cache. | |
| storageBucket | Storage.StorageBucket | 缓存存储桶。 | ENStorage bucket of the cache. | ||
| cacheName | ✔️ | string | 缓存的名称。 | ENThe name of the cache. |
📌CacheStorage.CachedResponse
缓存响应
EN
Cached response
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| body | ✔️ | string | 条目内容,采用Base64编码。(在通过JSON传递时编码为base64字符串) | ENEntry content, base64-encoded. (Encoded as a base64 string when passed over JSON) |
📌CacheStorage.CachedResponseType
HTTP响应缓存的类型
允许的值:basic、cors、default、error、opaqueResponse、opaqueRedirect
EN
type of HTTP response cached
Allowed Values:
Allowed Values:
basic, cors, default, error, opaqueResponse, opaqueRedirect返回类型:string
📌CacheStorage.CacheId
Cache对象的唯一标识符。
EN
Unique identifier of the Cache object.
返回类型:string
📌CacheStorage.DataEntry
数据输入。
EN
Data entry.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| requestURL | ✔️ | string | Request URL. | ENRequest URL. | |
| requestMethod | ✔️ | string | 请求方法。 | ENRequest method. | |
| requestHeaders | ✔️ | array[Header] | 请求头 | ENRequest headers | |
| responseTime | ✔️ | number | 自纪元以来的秒数。 | ENNumber of seconds since epoch. | |
| responseStatus | ✔️ | integer | HTTP响应状态码。 | ENHTTP response status code. | |
| responseStatusText | ✔️ | string | HTTP 响应状态文本。 | ENHTTP response status text. | |
| responseType | ✔️ | CachedResponseType | HTTP响应类型 | ENHTTP response type | |
| responseHeaders | ✔️ | array[Header] | 响应头部 | ENResponse headers |
📌CacheStorage.Header
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| name | ✔️ | string | |||
| value | ✔️ | string |