package ldp

  1. Overview
  2. Docs

Creates a cache from implementation of cache operations.


module I : Cache_impl


val clear : unit -> unit Lwt.t

Clear cache.

val get : (?headers:Cohttp.Header.t -> Iri.t -> (Cohttp.Response.t * Cohttp_lwt.Body.t) Lwt.t) -> ?headers:Cohttp.Header.t -> Iri.t -> (Cohttp.Response.t * string) Lwt.t

get call ?headers iri looks up in cache for iri and headers and returns the cached response, if any. Else uses call ?headers iri to retrieve the resource and stores it if request status is ok (code 2XX). The cookie header is removed from provided headers when looking and storing into cache.