[dokuwiki] Re: preventing instruction level caching


On 28 Apr 2009, at 01:48, James Lin wrote:


>Try "purge=1" in the query string part of the URL.
>Also an action plugin can hook into the PARSER_CACHE_USE event to use different logic to determine when to expire the cache, including always telling >dokuwiki to not use the cache.


I have tried hooking the PARSER_CACHE_USE, and running the following code:
$event->preventDefault();
$event->stopPropagation();
return false;

didn't seem to work, what if instead of preventing it caching, how to prevent reading from cache for a particular page in action plugin?

I don't think you've approached it right.

The default action is to determine whether or not to use the cache. If you handle the after advise, you can modify the result, set that value to whatever is required to get the behaviour you're after.

Or if you use the before advise, look at the dependency array and set something in that array which you know will cause dokuwiki's cache logic to make the decision you're after.

Iirc, the include plugin handles PARSER_CACHE_USE. Also take a look at inc/cache.php to see how the cache object works.

If you want to stop cache use for a particular page, look at the page id in the event data.

- Chris

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: