[Pmwiki-users] Problem with SimplePageCache script.

Reimer Behrends behrends
Mon Sep 22 20:23:51 CDT 2003


On Mon, Sep 22, 2003 at 07:47:04PM -0600, Patrick R. Michaud wrote:
> I haven't looked at the script until just now, but it seems
> to me like the timestamp portion of the script is working a bit harder
> than it needs to--I'm not sure what the opendir()/readdir() sequences
> are supposed to accomplish.

Its purpose is to have any change to a script in local/ invalidate the
cache. That is useful when you are working on adaptations in local/,
especially on local/local.php; checking for any changes there avoids
having to invalidate the cache each time. It also prevents the following
problem: commenting out the cache in local/local.php, then editing a few
pages, adding the cache back into local/local.php and being served stale
versions from the cache until the next edit.

> The problem may have to do with browser caching--since the script isn't
> reproducing the header() calls that PmWiki normally generates to
> prevent pages from being stored in a browser cache, your browser may
> be caching the old non-edited version of the document even though the
> wiki cache is being updated on disk.

Ignoring $HTTPHeaders is indeed a bug; prefixing the printing of the
cached content with:

	PrintFmt($pagename, "headers:");

should fix it. I'll fix that later this week, but I'm pretty busy
right now.

One other thing that I'm concerned about is that filemtime() is
supposedly being cached; however, I am under the impression that the
information isn't cached across scripts. If not, a clearstatcache()
should solve the problem.

> However, Reimer's script looks pretty straightforward and useful, so I may
> update it a bit to add some robustness and then add it to the PmWiki 
> distribution so that someone can enable caching of generated pages by 
> simply placing $EnableCache=1 in local.php or something like that.

Be my guest. I wrote the script because I needed something like this on
a pretty slow server, and there are still bits and pieces missing
(like a [[nocache]] directive) that I need to add at some later date,
but I don't have a problem with anybody else doing the work for me. :)

			Reimer Behrends



More information about the pmwiki-users mailing list