Module Fetch.Cache
Fetch caches.
val query_opts : ?ignore_search:bool -> ?ignore_method:bool -> ?ignore_vary:bool -> ?cache_name:Jstr.t -> unit -> query_opts
query_opts ~ignore_search ~ignore_method ~ignore_vary ~cache_name ()
are query options with given parameters.
type t
The type for Cache objects.
val match' : ?query_opts:query_opts -> t -> Request.t -> Response.t option Fut.or_error
match' c req
is a stored response forreq
inc
(if any).
val match_all : ?query_opts:query_opts -> t -> Request.t -> Response.t list Fut.or_error
match_all c req
is a list stored response forreq
inc
.
val add : t -> Request.t -> unit Fut.or_error
add c req
fetchesreq
and adds the response toc
.
val add_all : t -> Request.t list -> unit Fut.or_error
add_all c reqs
fetchesreqs
and adds their reponses toc
.
val put : t -> Request.t -> Response.t -> unit Fut.or_error
put c req resp
puts thereq
/resp
pair to the cache.
val delete : ?query_opts:query_opts -> t -> Request.t -> bool Fut.or_error
delete c req
deletes response toreq
from the cache.false
is returned ifreq
was not in the cache.
val keys : ?query_opts:query_opts -> ?req:Request.t -> t -> Request.t list Fut.or_error
keys c
are the requests cached byc
.
Cache storage
module Storage : sig ... end
Cache storage objects.