Ocsigen Start demo app

Caching the data

Module Eliom_cscache implements a cache of data that is designed for Eliom's client-server programming model. It permits saving a client-side copy of the data. Have a look at the module Os_user_proxy to see how it works (and use this module for getting information about Ocsigen Start's users).

When you get a piece of data through Eliom_cscache from client-side, the request to the server is done only if the data is not already in the client-side cache. On server-side, Eliom_cscache is using a temporary cache (with \"request\" scope) to avoid fetching the data several times from the database during the same request. This server-side cache is automatically sent to the client to fill the client-side cache. If you want to avoid too many requests from the client, prefill the server-side cache with the data the client program will need.

In the near future, Eliom_cscache will enable saving persistent data, which is useful for implementing off-line applications.