[Pmwiki-users] 404 Caching Cookbook

Evan Prodromou evan
Thu Jul 1 13:11:57 CDT 2004


Crisses <crisses at ofobscurity.com> wrote:

> I haven't tried this one yet.

Why let that stop you from writing a long email about how it couldn't
possibly work?

> But I did try the other caching script 
> and found that the authentication check made it untenable.

For read passwords? No, it won't support those. I don't consider them a
huge priority. But it would probably be possible to exclude certain
pages from caching. That way, pmwiki.php always runs for those pages,
and can do the password check.

>   When it did 
> need to generate a huge page such as AllRecentChanges it took it about 
> 4 times longer than it did to generate the page.

Hey, so, while we're complaining about irrelevancies, I once had this
uncle who had, like, TONS of hair coming out of his ear.

Also, the drive-thru lines at Burger King are always way too long.

> And expiring ALL 
> pages any time one page changed was another problem.

This is a problem of the 404-cache as well. I blame Pm for not having
good back-link functionality, so I can figure out which pages depend on
which others. B-) But I'm working on another extension to do this.

        http://www.pmwiki.org/wiki/Development/WhatLinksHere

My idea right now is to have two functions, WhatLinksHere($pagename) and
WhatDependsOn($pagename). Each will use an array of functions to
represent the rules of linking (WikiWords, free links) or dependency
(includes, redirects, headers, footers, etc.). For example, one rule
function might be:

function RcDepends($group1, $title1, $group2, $title2, $text2) {
        return ($title2 == 'RecentChanges' && 
                $group1 == $group2);
}

WhatLinksHere() would go through this array of functions for each page,
and if one returns true, then there's link.

This way, if you diddle with your Wiki syntax, you can write a custom
rule function and add it to the array.

Anyways, once that's done, the cache invalidation can just delete pages
that depend on the current page (and the current page, of course), and
be a little more optimal. It would also delete pages that link to the
current page, but only if the current page is new or being deleted.

(For caching, it'd be better to invert the meaning of the functions, and
delete all pages that nobody can prove _aren't_ related. But, y'know,
the WLH functionality is useful enough that it'd be wasteful to have two
sets of functions.)

Anyhow, that's where I'm at. I'd really like to make the caching more
optimal. Then again, this _is_ an 0.1 version.

~ESP

-- 
Evan Prodromou <evan at wikitravel.org>
Wikitravel (http://wikitravel.org/)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /pipermail/pmwiki-users_pmichaud.com/attachments/20040701/f0a370f3/attachment.bin


More information about the pmwiki-users mailing list