跳转到主要内容

Window: caches property

The caches read-only property of the Window interface returns the CacheStorage object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.

Value

A CacheStorage object.

Examples

The following example shows how a window can retrieve cached data.

caches.open("v1").then((cache) => cache.match("/list"));

Specifications

Browser compatibility

See also