package ocsigenserver

  1. Overview
  2. Docs
A full-featured and extensible Web server

Install

Dune Dependency

Authors

Maintainers

Sources

5.0.1.tar.gz
md5=528d59a39e9bda4c628022b4f1e0951e
sha512=1b8653487722ad26c0c0bfcf820402a783018039ce8b7c749ffb57bc80eeb1234464950ee639cb951c5b3dde1b4e85a992dfbbc782d55e7c2a356ff2f28a3917

doc/ocsigenserver.baselib/Ocsigen_cache/Make/class-cache/index.html

Class Make.cacheSource

new cache finder ?timer size creates a cache object where finder is the function responsible for retrieving non-cached data, timer (if any) is the life span of cached values (in seconds) (values in the cache are removed after their time is up) and size is the upper bound to the number of simultaneoulsy cached elements.

Whenever a value is found (using find method), it's lifespan is set to timer (or not if the cache is not time bounded). If the value was already cached, it's lifespan is reset to timer.

Using timer allow one to create a cache bounded both in space and time. It is to be noted that real lifespan of values is always slightly greater than timer.

method find : A.key -> A.value Lwt.t

Find the cached value associated to the key, or binds this value in the cache using the function finder passed as argument to create, and returns this value

method find_in_cache : A.key -> A.value

Find the cached value associated to the key. Raises Not_found if the key is not present in the cache

method remove : A.key -> unit
method add : A.key -> A.value -> unit
method clear : unit -> unit
method size : int
OCaml

Innovation. Community. Security.