[pmwiki-devel] Are page text variables cached?

Patrick R. Michaud pmichaud at pobox.com
Tue Nov 28 07:35:27 CST 2006


On Tue, Nov 28, 2006 at 09:57:00AM -0000, marc wrote:
> Wanting to reduce page reads to a minimum, I am trying to decide whether 
> I should put multiple page text variables on a single page, say:
>   Site.Variables
> or place the page text variables on the page that relates to the 
> variable.

I recommend putting them in the place that feels most natural
for the application.  With pagelists, page variables, and page
text variables I've basically discovered that whatever is
most straightforward is best.

> Part II is to help me understand the related code.
> [...]
> 
> The first if statement seems to answer my question above. Is this doing 
> what I think it's doing? Namely, caching all the page text vars for a 
> page.

Yes.  Once PmWiki is asked to scan a given page for page text 
variables, it caches any that it finds so that subsequent calls
to PageTextVars for the same page don't require the read.
(This is especially useful/important when page text variables
are being used in pagelists.)

> Does '=' in ['=pagetextvars'] have a purpose, or is it simply a naming 
> convention?

It's a naming convention to avoid conflicts with other page
attributes being held in $PCache.

> Is there a write-up about $PCache?

Not an official one, and I'd warn recipe and module writers away
from using $PCache at the moment, especially w.r.t. page variables,
since I'm likely to change it fairly radically before 2.2.0 is
released.

Pm



More information about the pmwiki-devel mailing list