[Pmwiki-users] 404 caching

J. Meijer commentgg
Thu Jul 8 08:35:29 CDT 2004


Hi Evan, I've read your contribution and clear explanations. Useful subject.
I'm learning.

Hey you're from wikitravel, coming over to pmwiki? Hmmm. Did you say people
over there have like tons of hair coming out of their ears? You shouldn't
start rumours like that.

You mention in your TODO:
- need better invalidation, now 404-chache invalidates all of the cache
after an edit.
- need cache management to limit cache size. So cache only a number of
pages.

It struck me that both needs can be met through a simple rule: invalidate
the page after it has been there for an hour. Or after it has been edited.
When there is high traffic on a page, it will come from cache, otherwise
pmwiki will regenerate it. So when the site suddenly becomes the hit it is
supposed to be, the wiki-server won't go down.

For most sites this will be a suitable strategy. It could be complemented
with selective flushing of the cache, typically of a group instead of an
entire wiki.
Pages such as GroupHeader might contain a property or directive indicating
the type of flush required, normally group-wide.

Flushing the entire site at once seems radical to me, one could instead
tighten the refresh cycle to say 10 minutes instead of a full hour. Or
simply flush at  the rate the server can regenerate pages, if you can manage
that, allotting the server idle time.

The problem of authentication could be resolved by pmwiki (or you), by
including a <!--[no404cache]--> directive inside the generated html.

Indeed (a patched) pmwiki could assist the WhatDependsOn and WhatGoesHere.
Should you really require these functions, I'm not convinced yet.

It is easy for pmwiki to maintain a list of actually included or considered
pages. I've actually suggested the inclusion of such a list in order to
break self-referential includes and in order not to include (and show) a
page (read a menu) twice. In the same way outgoing pagerefs could easily be
registered. In an array so a cookbook module can opt to store it in a file.

Of course you'd think of this. I'd sure like to use your script.

-jm








More information about the pmwiki-users mailing list