[Pmwiki-users] Cache system with PmWiki

Patrick R. Michaud pmichaud
Thu Sep 9 14:17:29 CDT 2004

On Thu, Sep 09, 2004 at 09:56:47PM +0200, Alexandre Courbot wrote:
> Also, I'd like to discuss some of the cache issues. There are lots of 
> them (others pages the page being visited depends on, etc.), but I 
> wonder if most of them couldn't be workarounded in PmWiki 2.0 by good 
> design. Like, a page file could contain all the pages it depends on - 
> and extensions could be provided a mechanism to register new 
> dependancies. 

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.)  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.

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.

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.

For 2.0 I am planning to put in a quick-and-dirty "what pages does 
this page link to" attribute when saving a page, but this is primarily
for finding referring pages and backlinks.  It probably won't handle
nested includes, group headers/footers, conditional markups, calendar
links, etc.

Finally, There aren't many clean ways to deal with the authorization problem, 
and it will all get a bit trickier once user-based authorization is 
introduced into 2.0.

> Are there plans in 2.0 to deal with 
> these problems? Are there tips to improve the general speed of the site?

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.


More information about the pmwiki-users mailing list