[dokuwiki] Re: Remove a page from the cache
- From: Christopher Smith <chris@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Wed, 25 Nov 2009 00:57:33 +0000
On 24 Nov 2009, at 18:02, Myron Turner wrote:
Christopher Smith wrote:
Note. I wouldn't consider using p_set_metadata to expire the cache
of the current page, you could have concurrency issues. If you
change the metadata before dokuwiki checks for cache validity,
you'll be fine. If you change it afterwards, its too late.
- Chris
Just want to get this straight. According to the document
http://www.dokuwiki.org/devel:caching#individual_page_cache_expiry
p_set_metadata can be used to expire the cache. But what I take
from the above is that this should be done in a BEFORE handler to
PARSER_CACHE_USE? That is, change the meta file before dokuwiki
makes it check.
Strictly yes. But why would you?
You have the cache object, you can delete the cached data [ $event-
>data->removeCache(); ]
You have direct access to the dependency array, you can set the
'purge' key to true [ $event->data->depends['purge'] = true; ]
You can handle the AFTER advise and control the return value - whether
or not DokuWiki should consider the cache object valid [ $event-
>result=false; ]
- Chris
Other related posts: