====== PARSER_CACHE_USE ====== ---- dataentry event ---- Description: manipulate the cache validity DefaultAction: determine whether or not cached data should be used Preventable: yes Added_dt: 2006-09-16 ---- Signalled by cache versions of parser wrapper functions [[xref>inc/parserutils.php]]. Syntax plugins can use this event to provide their own assistance to DokuWiki's cache (from cache key, via cache file location to validity logic) when the syntax extension adds other dependencies to the rendered page. ===== Passed Data and Result in event handler ===== The passed [[xref>dokuwiki\Extension\Event]] has the fields ''$data'' and ''$result''. ''$data'' is a cache object ([[xref>dokuwiki\Cache\CacheParser]] or extended on that object) -- refer [[xref> inc/Cache/CacheParser.php]]. For handling the event, key properties of the CacheParser object are: * ''$page'', if present the wiki page id, may not always be present, e.g. when called for locale XHTML files * ''$file'', source file * ''$mode'', renderer mode (e.g. 'xhtml') or 'i' for instructions * ''$key'', primary identifier, will be md5 hashed part of the cache file * ''$ext'', secondary identifier, extension of the cache file, readable part * ''$cache'', cache name generated by [[xref>getCacheName()]] * ''[[xref>$depends]]'', array of dependencies used to determine cache validity In the BEFORE event handler the cache object can be modified. Some examples are: extending the ''$depends'' field, using more cachefiles for variants of the same source file (see also [[plugin:struct]] plugin) or preventing and replacing the default ''makeDefaultCacheDecision()'' cache check. In the AFTER event handler the ''$result'' field is set with the result of the [[xref> makeDefaultCacheDecision()]] method. The AFTER event handler can modify this field. ===== See also ===== * [[codesearch>PARSER_CACHE_USE|Code related to this event]] used in any DokuWiki's files, plugins and templates * [[devel:caching#plugins|Influencing of cache by plugins]] * [[devel:Action Plugins]] * [[devel:Events]]