[Moin-user] Caching generated content from a parser

Paul Boddie paul at boddie.org.uk
Fri Dec 2 18:18:29 EST 2011


On Friday 02 December 2011 21:45:35 Paul Moore wrote:
> I'm writing a parser which generates content (an image) based on the
> text provided to the parser - something like the Google Chart or
> Graphviz parsers. I'm trying to decide where would be the best place
> to store the generated content. The Google Chart parser uses the
> cache, which feels like the best option to me. (The Graphviz parser's
> use of attachments feels like it exposes too many of the gory details
> to the user for me).

This is precisely the dilemma I had recently: I was/am writing a chart data 
parser that uses SVG as output. I've chosen to go with attachments, however, 
just like the Graphviz parser (the simpler one of the two, at least) because 
the caching behaviour was driving me up the wall, whereas you can always 
delete attachments manually and guarantee that the parser will regenerate the 
output. Another benefit is that if you ever need to export the page, it might 
be sufficient to just write a script to grab the page and attachments.

Paul




More information about the Moin-user mailing list