Hi Lenya devs,
giving the generation of navigation widgets more thought, especially
regarding the performance aspects, I came to the conclusion that the
current approach is inflexible and insufficient.
The Problem
===========
For each navigation widget, the whole sitetree is generated and then
stripped down to the (sometimes tiny) portion which is actually used to
render the widget. The stripping is done in XSLT, which is naturally
quite slow. This generates a huge performance overhead. The only way to
reduce the performance impact is to cache the resulting navigation
widgets. The whole approach is apparently inefficient.
If the widgets must be cached, it's not possible (or at least very
complicated) to utilize information from outside the sitetree during the
rendering of the widgets. Apart from that, the cache validation is not
trivial and stale widgets can occur.
The Solution
============
Instead of generating the whole sitetree and stripping it down, only the
fragment of the tree which is actually used is generated. This is done
by a SiteFragmentGenerator, which utilizes a custom FragmentSelector for
each type of widget. Typical FragmentSelector implementations are
BreadcrumbSelector
ChildrenSelector (for tabs etc.)
SubtreeSelector (for menus etc.)
This way, the performance impact is reduced to the necessary minimum.
Combined with the metadata-based transformation, we can provide a
flexible and performant way to render navigation widgets.
I'm currently testing this approach in the docu publication. It looks
like it is very efficient, and the caching issues (stale widgets) have
disappeared. I'll keep you up to date about my investigations.
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]