CacheStorage

js.html.CacheStorage (extern class)

The CacheStorage interface represents the storage for Cache objects.

Documentation CacheStorage by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

match(request: Request, ?options: Null<CacheQueryOptions>): js.lib.Promise<Response>

Checks if a given Request is a key in any of the Cache objects that the CacheStorage object tracks, and returns a Promise that resolves to that match.

Name Type Default
request Request
options Null<CacheQueryOptions> (optional)
Returns
js.lib.Promise<Response>

has(cacheName: String): js.lib.Promise<Bool>

Returns a Promise that resolves to true if a Cache object matching the cacheName exists.

Name Type
cacheName String
Returns
js.lib.Promise<Bool>

open(cacheName: String): js.lib.Promise<Cache>

Returns a Promise that resolves to the Cache object matching the cacheName (a new cache is created if it doesn't already exist.)

Name Type
cacheName String
Returns
js.lib.Promise<Cache>

delete(cacheName: String): js.lib.Promise<Bool>

Finds the Cache object matching the cacheName, and if found, deletes the Cache object and returns a Promise that resolves to true. If no Cache object is found, it returns false.

Name Type
cacheName String
Returns
js.lib.Promise<Bool>

Returns a Promise that will resolve with an array containing strings corresponding to all of the named Cache objects tracked by the CacheStorage. Use this method to iterate over a list of all the Cache objects.

Returns
js.lib.Promise<Array<String>>

new(namespace: CacheStorageNamespace, principal: Dynamic): Void
Name Type
namespace CacheStorageNamespace
principal Dynamic