Dokuwiki - Cache Dev configuration

Card Puncher Data Processing

Cache

https://www.dokuwiki.org/devel:caching

Cache Structure

Cache.php structure:

Dokuwiki Cache Class

Instruction

In cache.php, set $_nocache to true

/**
 * Generic handling of caching
 */
class cache {
    public $key = '';          // primary identifier for this item
    public $ext = '';          // file ext for cache data, secondary identifier for this item
    public $cache = '';        // cache file name
    public $depends = array(); // array containing cache dependency information,
                               //   used by _useCache to determine cache validity

    var $_event = '';       // event to be triggered during useCache
    var $_time;
    var $_nocache = true;  // if set to true, cache will not be used or stored

Rendering

Disable the whole render cache by setting the cache page time to -1.

See

cache→_addDependencies

in cache.php, instructions if ($conf['cachetime'] == -1)

No cache

It disable only XHTML cache (ie the rendering function), not the handle function.

Purge

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

Javascript

http://www.example.com/lib/exe/js.php?purge=true

When you are developing new JavaScript, be sure to refresh your browser cache (hitting Shift-F5, Shift+CTRL+R or similar) whenever your script was updated.

DokuWiki will load JavaScript from the following places:

  • autogenerated JavaScript (language strings, config settings, toolbar)
  • lib/scripts/*.js
  • lib/plugins/*/script.js
  • lib/tpl/<currenttemplate>/script.js
  • conf/userscript.js

Plugin !!! The script file is named script.js at the root directory of the plugin. If this file is an include as in the move plugin, be sure to touch this file when one of the scripts has been updated to refresh caching.

As the cache check the date of this file.

jQuery(function() {
    /* DOKUWIKI:include script/form.js */
    /* DOKUWIKI:include script/progress.js */
    /* DOKUWIKI:include script/tree.js */
    /* DOKUWIKI:include script/rename.js */
    /* DOKUWIKI:include script/admin_list.js */
});

Css

http://www.example.com/lib/exe/css.php?purge=true

Ctrl+F5 to suppress the browser cache because browsers cache stylesheets even when new versions are available.

Image

Images caching

Local Server:

{{php.gif?nocache}}
{{php.gif?300x50&nocache}}

External Server with the cachetime config option

{{http://de3.php.net/images/php.gif?recache}}

Configuration

Turn off “Compact CSS and JavaScript files” while developing a template

Php

clearstatcache file status cache





Discover More
Phpinfo Mbstring Enabled
Dokuwiki - Dev environment Configuration and Installation

This is the installation and configuration of the dokuwiki development platform on Windows that we use. slow. Docker with the last WSL2 is really, really slow if you don't work in WSL two environment...



Share this page:
Follow us:
Task Runner