og:1351282081 wrote
my plugin should detect if there are changes in an internal directory and then trigger some action. Currently i'm using a syntax-plugin for this, but it is only executed on saving the page. Even ~~NOCACHE~~ pragma on page did'nt work for me.
NOCACHE or disabling the cache in the syntax plugin only disables the renderer cache, not the parser cache. This is why the handle()-function isn't called again. The idea behind this is that everything that shouldn't be cached should happen in render() as rendering the page again is a lot faster than parsing it again as parsing is quite expensive.
As turnermm has already said you can use an action plugin in order to selectively disable the cache, i.e. then you can use caching and only purge the cache when it is actually needed. You can tell the action part that the syntax is used by setting a certain metadata property. A simple example for that can be found in the
navi plugin. A more complicated cache handling code can be found in the
include plugin. If you don't need to handle external media edits (i.e. when media files are written from outside DokuWiki) you could simply add
$conf['mediadir'].'/_media.changes' as file dependency (as you can see in the navi plugin for the page), this file will be written every time a media file is changed. Even though with the action part you can also disable the instruction I would recommend to only disable the renderer cache and to move the code that depends on the media data from the handle function to the render function.