Module Js_of_ocaml.Cache

Cache API: persistent storage of Fetch Request/Response pairs.

Available from Dom_html.window and from ServiceWorker contexts; the Cache API requires a secure context. The methods are Promise-typed — see Promise.

class type queryOptions = object ... end

Options controlling how a request is matched against cached entries. Create an empty record with empty_query_options.

val empty_query_options : unit -> queryOptions Js.t
class type multiQueryOptions = object ... end

Like queryOptions but with a cacheName to restrict cacheStorage##match_withOptions to a single named cache. Create an empty record with empty_multi_query_options.

val empty_multi_query_options : unit -> multiQueryOptions Js.t
class type cache = object ... end

A single named Cache instance, obtained from cacheStorage.

class type cacheStorage = object ... end

The set of named Caches for the current origin, exposed as the global caches (see caches).

val caches : unit -> cacheStorage Js.t

The caches global (CacheStorage) for the current origin. Guard with is_supported in environments where the Cache API may be missing.

val is_supported : unit -> bool

Whether the caches global is available in the current environment.