caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Marc Weber <marco-oweber@gmx.de>
To: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] SQL engine in OCaml with client side cache
Date: Sun, 29 Jan 2012 12:39:48 +0100	[thread overview]
Message-ID: <1327836859-sup-8144@nixos> (raw)
In-Reply-To: <CAHqiZ-Jra20HXK2ma-Sqzrw2srUcY61mHSkH3TufYtB9_0yM4A@mail.gmail.com>

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

  parent reply	other threads:[~2012-01-29 11:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-29  9:56 Diego Olivier Fernandez Pons
2012-01-29 11:15 ` Gerd Stolpmann
2012-01-29 18:29   ` Diego Olivier Fernandez Pons
2012-01-29 20:16     ` Gerd Stolpmann
2012-01-29 23:26       ` Diego Olivier Fernandez Pons
2012-01-30  9:12         ` Gabriel Scherer
2012-01-31 15:04         ` Gerd Stolpmann
2012-01-29 11:39 ` Marc Weber [this message]
2012-01-29 13:42 ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327836859-sup-8144@nixos \
    --to=marco-oweber@gmx.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).