[dokuwiki] Re: Content-dependent Purge/Cache

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 11 Jan 2007 13:17:30 +0000

Tognini Samuele wrote:
Tognini Samuele wrote:
Todd Augsburger wrote:
3) The action plugin also re-reads the original file, and if it does not contain wiki code for a comment, it uses p_set_metadata() to clear the flag, essentially refreshing the metadata.
Hi,
is there a way in last DW stable release to unset a specified metadata value or the only solution is give an empty array to p_set _metadata and unset all metadata values?
Thanks,
Samuele

I 've notice now that p_set_metada($ID,array()) doesn't works as i thought. I need me too to clear a metadata value in order to prevent cache purge when a syntax plugin is not used anymore.
How have you cleared the flag?
Could deleting the meta file (with unlink) lead to errors or lost of informations if it's done inside the PARSE_CACHE event?

Samuele
You need to update to devonly release (or a nightly). If you check back through mailing list you'll see a discussion on persistent/volatile metadata either in Nov or Dec[1]. iirc the last message will say when the patch to implement went into the dev version.

I think some parts of the change are documented in splitbrain. Search on metadata. p_set_metadata now has an extra parameter, which defaults to persistent.

**IMPORTANT**
If you have a syntax mode that needs to set metadata of the current page, you should *NOT* use p_set_metadata, but add support for metadata rendering to your plugins render() method. Combined with the patch in devonly DW, this will properly handle the removal of metadata when your syntax no longer appears on the page.

Deleting the metadata file will cause a loss of the persistent information that is stored in there, irregardless of where it is done.


Cheers,

Chris


[1] Be careful if updating to this. There is a bug that will affect you if your wiki files don't already have metadata (pre 2006-11-06 version) and you use "display first headings". You can get around the bug by turning off "display first headings". You need to leave the setting off until DW has managed to create metadata files for all pages. Spidering your wiki once should accomplish that.
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: