DokuWiki speeds up browsing through the wiki by caching parsed files1). If a currently cached version of a document exists, this cached copy is delivered instead of parsing the data again. On editing and previewing no cache is used.
To force the recaching of a single page just add the parameter purge to the URL. Example:
http://www.example.com/namespace/page?purge=true
To force recaching of all pages, including page instructions, touch2) the local configuration file, conf/local.php.
To only force recaching of page xhtml, touch inc/parser/xhtml.php.
DokuWiki uses two cache files per page. To understand this you need to know that a page is parsed to an intermediate instruction format first before it is rendered to XHTML. DokuWiki caches both – the instructions and the rendered XHTML.
The XHTML and instruction cache are located in data/cache/* 6). The files end in .xhtml, .i. Other files are also stored under the cache directory, including:
.feed — any rss feeds generated for the wiki.code — portions of the page between <code> ... </code> tags after highlighting has been applied.
Plugins can now influence cache use via the PARSER_CACHE_USE event. This allows plugins which introduce additional dependencies for specific pages to check those dependencies and force DokuWiki to refresh the page when it wouldn't normally.
Up until now plugin developers have only been able to turn off caching completely. This has been necessary for plugins like discussion & include. To make use of the new functionality a syntax plugin will need to:
$INFO['metadata'] and the p_get_metadata() and p_set_metadata() functions. If using metadata please try to stick to Dublin Core Metadata standards.PARSER_CACHE_USE event.Caching itself is handled by the cache object7). The key parts of that object of interest to plugins are:
depends array — DokuWiki fills this all the known dependencies of the page and then uses standard routines to process them. Plugins can add/modify these dependencies before they are processed. The different types of dependencies are:purge — expire the cacheage — expire the cache if its older than agefiles — expire the cache if it is older than any of the files in this array. Only local files may be added.cache — a unique identifier under which the cache is stored. Normally it is dependent on the page name, HTTP_HOST and the server port. Plugins can generate more complex identifiers, e.g. the include generates identifiers using included page names and whether or not the current user has read access to those pages.