目录

currently translating FIXME

缓存

DokuWiki 通过缓存解析过的文件1)来加快浏览速度。如果一个当前缓存的文件版本已经存在,这个缓存的拷贝会直接发送到客户端,而不会重新解析数据。编辑和预览时不会用到缓存。

清理缓存

要强制重新缓存一个单独的页面,只要在 URL 中添加 purge 参数。例如:

http://www.example.com/namespace/page?purge=true

要强制重新缓存所有的页面,包括页面指令,可以执行 touch 2) 命令重新生成本地配置文件,conf/local.php

要强制重新缓存 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.

位置

XHTML 和 指令缓存在 data/cache/* 路径下 6)。文件名以 .xhtml.i 结尾。其它文件也会保存了这个缓存目录下,包括:

插件

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:

Caching itself is handled by the cache object7). The key parts of that object of interest to plugins are:

1) 图像缓存请参见 images
2) 非 Unix 用户可以简单地打开文件并重新保存 – 这么做是为了更新文件的时间戳
3) conf/dokuwiki.php & conf/local.php
4) inc/parser/parser.php & inc/parser/handler.php
5) inc/parser/xhtml & inc/parser/metadata
6) * 以单个字符为目录名,
data 是在 savedir 中设置的目录
7) inc/cache.php