It is the responsibility of the Provider to deal with the question 'is the
content I'm serving cacheable?' If a provider claims that content is not
newer than what AxKit has served before, then it will get served from the
cache, but in one sense you're right, its an 'all or nothing' sort of
caching, the current system cannot say "oh, the XSP part of the pipeline is
the same but I need to just reapply this XSLT transform at the end".
HOWEVER, stylesheets are always maintained in memory pre-parsed. AxKit will
not reparse the same DOM. This is part of the function of caching, if the
provider (and stylesheets use them too) says AxKit already has a fresh copy
of a stylesheet then it won't be reparsed! I would like to note that it tends
to be a bit excessive about that in some cases too... Like I've found
situations where document() or XInclude will give you a stale DOM (they may
be fixed now too).
One thing you can do which will let you have more flexibility in what is and
isn't cached is to use XInclude or the XSLT document() function. If you pull
in data from another local URL its going to have its own caching rules and
often something like a dynamic sidebar or whatnot can be cached even when
other content on the page isn't, and these techniques will let you do that.
Its not a perfect caching scheme and there is a patch around that may one day
get into 2.0 which allows for more flexible caching, but it works pretty well
99% of the time and I sure haven't found a need to ditch AxKit in order to
optimze caching behaviour yet ;o).
On Monday 08 September 2003 06:14 pm, Arne Claassen wrote:
> From what i can tell (which is without benefit of docs, since i can't
> seem to find any on caching and AxKit), caching works only for the
> finalized document, correct? There's no caching of stylesheets, so that
> it doesn't have to be loaded for every page that requires it (assuming
> the resulting page is not cached).
>
> So let's say i have an app that goes something like this (much
> simplified and left out):
>
> ----------------------------------------
> # $xml contains dynamic application data
> # $xsl contains a dynamically loaded stylesheet
>
> my $stylesheet = $xslt->parse_stylesheet($xsl);
> my $results = $stylesheet->transform($xml);
>
> $r->print( $stylesheet->output_string($results) );
> ----------------------------------------
>
> vs. the Provider::Filter version of
>
> ----------------------------------------
> $r = $r->filter_register(); # Required
> my $stylesheet =
> '<?xml-stylesheet href="/somestyle.xsl" type="text/xsl"?>';
>
> $r->print("$stylesheet\n$xml" );
> ----------------------------------------
>
> The first i know how to add not only stylesheet caching, but even
> stylesheet pre-compilation. Is the same possible with the latter? Or
> should i forgoe AxKit for the dynamic XML/XSL, build my own caching and
> use AxKit just for static XML/XSL?
>
> thanks,
> arne
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Tod Harter
Giant Electronic Brain
http://www.giantelectronicbrain.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]