[Pmwiki-users] Cache system with PmWiki

Alexandre Courbot Alexandre.Courbot
Fri Sep 10 02:01:58 CDT 2004

> A page file doesn't always know what pages it depends on until the
> page is actually processed.  This becomes especially true when dealing
> with conditional markup and includes.  (Conditional markup especially
> makes page caching tricky.)

It could create this list once an edit is submitted. As for conditional 
markup, it should adopt a worst case policy i.e. check all conditional 

>  You can come up with some pretty good hints
> and some heuristics that work "most of the time", but there are always
> some edge cases that don't make it through.  This is especially true
> with extensions such as wikilog (calendar) and the like where the
> page markup doesn't contain direct links to the other pages.

Hence the need to allow extensions to register markup which might 
introduce a dependency. Take, for instance, the [[include:]] directive. 
You could have a regexp that matches it to add the indicated page as a 
dependency. An array of pages this one depends on, created at edit time, 
should allow both pmwiki and extensions to work together in a cache-safe 

> The solution I've used in the past is that making an edit to *any* page 
> invalidates the cache for all pages.  There's little chance of anything
> going wrong.  If the number of pages browsed is much greater than the 
> number of edits, you benefit, and if the number of pages browsed is not
> much greater than the number of edits, then caching isn't helping/hurting
> much anyway.

Yep, currently that's what we are doing - at least once we figure out 
how to get the password stuff to work again.

> PmWiki 2.0 will also be making use of the If-Modified-Since header, 
> which also greatly improves performance (and reduces bandwidth requirements)
> by allowing browser caches to do their job again.

That's a very good point! :)

> Fixing If-Modified-Since will be a big help, and we can see about
> some limited caching, but coming up with something that handles every
> case (especially given some of the extensions available) is likely to
> be a big challenge.

If you decide to go the way for caching (which should be IMO present in 
the script/ directory along with the PmWiki distribution, and enabled by 
setting a global variable), I think the safest way to go is to allow 
extensions to inform the caching system about their dependencies. But 
indeed, there will be some tricky parts, especially if 2.0 displays 
things like user login and so forth... Another solution could be limited 
caching of the Wiki markups (or at least part of it), since this is the 
part of the processing that takes the more time.

Alexandre Courbot
PhD Student - LIFL/RD2P

More information about the pmwiki-users mailing list