Mon Apr 19 09:49:15 EDT 2010
Caching for ramblings.ss
There seem to be only 2 important parts to cache:
- the initial parse (indexing).
- the tex rendering
In diagram form, only 3 kinds of nodes.
[ TXT ] -> [ ARTICLES ] -> out
-> [ PNG ] -> out
TXT: The file node, invalidated by the FAM daemon
ARTICLES: Indexed (segmented) file. Can serve raw text to output:
we don't cache normal xhtml results.
PNG: Tex rendering takes some time and produces multiple pages, so
it's also cached.
This caching strategy should be abstracted in a single module:
It looks like implementing this, once it is made explicit like this,
is quite straightforward. However, in order to get the whole thing to
work, the representation (what _is_ an article?) needs to be fleshed
out. For simple text it's straightforward (an xhtml document), for
tex rendered it is more than that (a key-value store).
Caching xhtml output does simplify the architecture, that way the
[ TXT ] -> [ ARTICLES ] -> [ query -> RESPONSE ]