From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0TBdtiF015616 for ; Sun, 29 Jan 2012 12:39:55 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiADAM8uJU/VpUAXjmdsb2JhbABChQuaWIxDglQBAQEBCQsJCRIFIoFyAQEFIwQLAVYLGgIYDgICEEcGiBKcFIpykF6BL4cOAQQDBAkBAwwEAwQtAgIQAQUDAYQcBA8CAQaCKYEWBJp/jG0 X-IronPort-AV: E=Sophos;i="4.71,587,1320620400"; d="scan'208";a="129280734" Received: from mailout-de.gmx.net ([213.165.64.23]) by mail4-smtp-sop.national.inria.fr with SMTP; 29 Jan 2012 12:39:50 +0100 Received: (qmail invoked by alias); 29 Jan 2012 11:39:48 -0000 Received: from g226211171.adsl.alicedsl.de (EHLO mail.gmx.net) [92.226.211.171] by mail.gmx.net (mp069) with SMTP; 29 Jan 2012 12:39:48 +0100 X-Authenticated: #9006135 X-Provags-ID: V01U2FsdGVkX1+GHe5oswqGXVRYTLF9avqSpxfCTtWTEzDZNAq31e AKb9gE3t/tgfYY Received: by mail.gmx.net (sSMTP sendmail emulation); Sun, 29 Jan 2012 12:39:48 +0100 Content-Type: text/plain; charset=UTF-8 From: Marc Weber To: caml-list In-reply-to: References: Date: Sun, 29 Jan 2012 12:39:48 +0100 Message-Id: <1327836859-sup-8144@nixos> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 Subject: Re: [Caml-list] SQL engine in OCaml with client side cache Excerpts from Diego Olivier Fernandez Pons's message of Sun Jan 29 10:56:25 +0100 2012: > On the other hand, the data I am working with has good properties > - read only Libraries like smarty (PHP caching framework) do it this way : fun render_and_cache_id (id) let query_db_then_render = fun() -> build_html ( query_db ( id_of_thing .. )) return cache(id, timeout, render_html) endf id is the id identifying the database data. Thus for each id the database is queried only once - and the data is only rendered once. Obviously this only works great if you have readonly data - or if its ok if your data is out of date. You can invalidate it using timeouts etc. Marc Weber