[pmwiki-users] How to chouse PmWiki caching method?
eemeli at gmail.com
Tue Feb 5 12:54:29 CST 2008
On Feb 5, 2008 8:28 AM, imoc <blog.oc at gmail.com> wrote:
> I'm looking for cache for PmWiki. There are several ways to do it. But
> while searching around the list here I found PmWiki's "$EnableHTMLCache"
> and many other settings which seemed to be the original function in PmWiki.
> But I can not find any document describe them at 'pmwiki.org'.
> Can anyone compare the difference between
I'm the developer of FastCache, so my opinions may be a bit biased.
But here goes:
> 1) the original PmWiki caching function, and
This is a very safe and easy thing to do, but may not help you much on
more complicated pages. If set, PmWiki will store the HTML generated
for a page's text only, and on later access won't have to parse the
wikimarkup into HTML. There's also a pagelist cache that may help you.
Here's what I have in my config files to enable all of this:
$EnableHTMLCache = 1;
$WorkDir = 'work.d';
$PageCacheDir = $WorkDir;
$PageListCacheDir = $WorkDir;
All of this should be quite safe and transparent, and shouldn't
disrupt at least FastCache (don't know about StaticPages). This
transparency does come with a price, though, as any page that has a
(:title:) or some other tag that influences things outside the main
text of the page simply won't be cached.
> 2) the FastCache recipe here:
> http://pmwiki.org/wiki/Cookbook/FastCache ,and
FastCache will only speed things up on anonymous access, but for that
it'll really speed things up by serving static pages and never
accessing PHP. For that to happen, you'll need to add some mod_rewrite
rules to your Apache server configuration.
Internally, the way it works is by writing a page to the cache only
when that page is anonymously accessed and there's no cached copy
(using output buffering). If there is a cached copy, the mod_rewrite
rules (or if that's not possible, PHP code) serve the static HTML
page. By default the cache is invalidated (ie. the files deleted) when
any page on the wiki is edited. This means that all pagelists etc. are
valid, since any change to the wiki causes the cached pages to be
regenerated on the next access. (minor note: FastCache doesn't
recognise date conditionals etc. that mean a page shouldn't be cached,
so you'll need to add a (:nofastcache:) tag to those pages)
In short, FastCache should help you if changes to the wiki happen
relatively infrequently compared to anonymous page views. If your
wiki's too slow due to too many logged-in users, there's very little
in addition to the default PmWiki stuff that you can do, as there's
really no other easy way to account for all the skin customizations
for users and for checking authorization levels.
> 3) the StaticPages recipe here:
I never actually got StaticPages to work as intended, but that may be
just me. From what I can tell, the recipe achieves the same goals as
FastCache (serving static pages) by saving the pages as HTML when
editing and by redirecting internal wiki links to point to the cached
files on the server instead of the actual wiki pages. This means that
you'll have the same page available from two different locations.
Also, as far as I can tell, with StaticPages, accessing pages via the
wiki URL will always serve the dyamically generated page. Finally, I
never quite figured out how StaticPages invalidates its cache and
updates eg. references on other pages to the edited page's text
variables and such.
> If I have a site built full of PageLists, which one would be batter? Can
> they work together?
At a minimum, I'd recommend enabling all the default PmWiki caching as
above. If that's not enough and you're afraid of getting slashdotted,
try one of the two others -- they won't really work together. Take a
look at both, and pick the one that you understand better (and can get
More information about the pmwiki-users