On Wed, 2004-05-12 at 15:42 +0200, Erik Moeller wrote:
I've committed a feature which makes it possible to collapse long pages and load individual sections from the TOC. I've also improved section editing/viewing behavior to load subsections within a section instead of just the mother section. Long pages are collapsed when the user explicitly requests it ("Collapse page"), or when they are above a size threshold which can be set in the prefs (default 30K). I coded this primarily to address super-long pages like VfD.
Hm, how does this integrate with caching? I would also vote for switching this feature off by default, especially for anon users (no caching for the biggest pages otherwise).
In terms of code, this isn't very clean yet as we have two quite redundant TOC generators now, one which generates from source and the other which generates from HTML. We probably should get rid of the one which generates from HTML and use the source generator for both types of TOC. This isn't entirely trivial as the TOC generation in OutputPage is entangled with other things like headline numbering and section edit links.
On the plus side, rendering of collapsed pages is very fast as indeed only the intro has to be rendered (the headlines are also converted to HTML to make stripping of wikitags easier, but this is concatenated into a single step and thus quite unnoticeable).
Instead of re-rendering pages for everyone i think it would make more sense to render the page only once and do the customizations in js/css as far as possible. Hiding sections via js or css for the browsers that support it similar to what we do with the toc currently shouldn't be too hard and would save many round-trips to the server and repeated rendering.
Cheers