Refactoring Proposal: Prerender topics to save time when viewing them
Motivation
The amount of work required to display a topic is huge. We need to reduce this amount of work to speed up TWiki.
Description
We could try to move some of the renderwork to when the topic is saved.
For example: at our Twiki, a lot of topics do not contain variables. That means that the only real varying thing about the topic itself (not the lefbar etc.) is the way the
WikiWords are renderred. Lists, tables, headings and wikiword selection could be done when saving the topic, saving time when reading the topic.
--
KoertVeer - 03 Feb 2006
Impact and Available Solutions
Documentation
Examples
Implementation
I am currently trying to split getRenderedVersion into two function: getPreRenderedVersion and getPostRenderedVersion. getPreRenderedVersion tries to do as much as possible, postponing things it cannot do to getPostRenderedVersion. Those things usually involve a dependancy on some external factor such as user preferences or other topics. Currently i postpone all non
TML to getPostRenderedVersion, but that could of course be improved.
Other options to consider
- A plugin/subsystem could notify the renderer that a prerendered version is user-specific, a cachesystem would keep versions of that page for every user separately.
- A plugin/subsystem could notigy the renderer that a prerendered version expired on a certain date or time. That way even searches could be cached whithout having a major impact on validity (for example by specifying an 30 minute timeout for searches).
- A topic could store its dependencies. That way even Warning: Can't find topic "".""
could be prerendered.
Discussion