Cache and CacheStorage Flashcards

1
Q

What is CacheStorage?

A

The CacheStorage interface represents the storage for Cache objects. It provides a master directory of all the named caches that a ServiceWorker, other type of worker or window scope can access (you don’t have to use it with service workers, even though that is the spec that defines it) and maintains a mapping of string names to corresponding Cache objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does CacheStorage expose?

A

CacheStorage.open() and CacheStorage.match().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe: CacheStorage.open().

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What method is used to obtain a Cached instance?

A

CacheStorage.open().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What method is used to check if a given Request is a key in any of the Cache objects that the CacheStorage object tracks?

A

CacheStorage.match().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe: CacheStorage.has().

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe: CacheStorage.match().

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe: CacheStorage.delete().

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe: CacheStorage.keys().

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly