Re: yelp:cache implementation



On Thu, 2006-06-29 at 21:04 -0600, Brent Smith wrote:
> (sorry sent this to the wrong list originally)
> 
> This is the first rough pass at an implementation of a yelp:cache 
> extension element.
> 
> Shaun and I discussed this on IRC and basically the premise is that if a 
> template depends solely on a xsl:param element that is passed to it, 
> then we can cache the results of that template and if it is called again 
> with the same parameter, then we look up the result in a hash table 
> instead of performing all the XSLT again.

[snip]

> Shaun had some concerns about localization, but I don't think this 
> should affect it since the extension element function caches the actual 
> result of the db.number.mode template.  That is unless the result of 
> db.number.mode is dependent on the depth of numbering as well as the 
> $node parameter...

My concern was with mixed language documents.  Imagine
a German document that was only partially translated.
It has two sections, which we'll call "Abschnitt Eins"
and "Section Two".  The first was translated.

If we have a cross reference to Abschnitt Eins from
Section Two, what should the text of the link read?
It occurs to me that currently, we don't actually
look at the enclosing language of the xref when we
construct the text, so it will always be in German.

With the current setup, yelp:cache won't affect the
localized output.  But say we did switch it.  Then
we would get "Abschnitt Eins" if we reference from
the newly-written "Abschnitt Drei", but "Section One"
if we reference from "Section Two".  That might be
a desirable behavior, and the cache would interfere
with that, unless we take the context language into
consideration when creating the hash key.

We'll worry about it if it becomes a problem later.
Right now, let's get some speed in.

--
Shaun





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]