DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:caching

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
devel:caching [2016-10-09 22:22] – dumbass glendevel:caching [2018-05-30 15:21] – [developer note] Klap-in
Line 26: Line 26:
 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. 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.
  
-  * __Instruction Cache__ \\ The instruction cachefile only gets updated when the page, the config files((''conf/dokuwiki.php'' & ''conf/local.php'')), some of DokuWiki's PHP files((''inc/parser/parser.php'' & ''inc/parser/handler.php'')) are changed or plugins are added/removed/enabled/disabled using the [[:plugin:plugin]] manager.+  * __Instruction Cache__ \\ The instruction cachefile only gets updated when the page, the config files((''conf/dokuwiki.php'' & ''conf/local.php'')), some of DokuWiki's PHP files((''inc/parser/parser.php'' & ''inc/parser/handler.php'')) are changed or plugins are added/removed/enabled/disabled using the [[:plugin:Extension]] manager.
  
   * __%%XHTML%% Cache__ \\ The XHTML cache is also affected by a maximum cache age setting ([[:config:cachetime]]), its metadata, some more php files((''inc/parser/xhtml'' & ''inc/parser/metadata'')), whenever the existence state of an internal link changes (i.e. the link target page is created or deleted) or when an [[:RSS]] feed needs refreshing.   * __%%XHTML%% Cache__ \\ The XHTML cache is also affected by a maximum cache age setting ([[:config:cachetime]]), its metadata, some more php files((''inc/parser/xhtml'' & ''inc/parser/metadata'')), whenever the existence state of an internal link changes (i.e. the link target page is created or deleted) or when an [[:RSS]] feed needs refreshing.
Line 55: Line 55:
 A simple measure to avoid caching is that plugin developers turn off caching completely. This is discouraged due to the extra rendering activities, in particular adversely for high traffic wikis. Instead of the plugin developers make use of the functionality to influence the cache by checking (themself formulated) dependencies. Therefore a syntax plugin will need to: A simple measure to avoid caching is that plugin developers turn off caching completely. This is discouraged due to the extra rendering activities, in particular adversely for high traffic wikis. Instead of the plugin developers make use of the functionality to influence the cache by checking (themself formulated) dependencies. Therefore a syntax plugin will need to:
   * save some information relating to the pages it's involved with and the dependency specific to each of those pages.  The page's [[:metadata]] is a useful place for this.  Metadata can be accessed via ''$INFO['metadata']'' and the ''p_get_metadata()'' and ''p_set_metadata()'' functions. If using metadata please try to stick to [[http://dublincore.org|Dublin Core Metadata standards]].   * save some information relating to the pages it's involved with and the dependency specific to each of those pages.  The page's [[:metadata]] is a useful place for this.  Metadata can be accessed via ''$INFO['metadata']'' and the ''p_get_metadata()'' and ''p_set_metadata()'' functions. If using metadata please try to stick to [[http://dublincore.org|Dublin Core Metadata standards]].
-  * add an [[action_plugin]] component to handle the ''[[devel:event:parser_cache_use|PARSER_CACHE_USE]]'' event.+  * add an [[action plugin]] component to handle the ''[[devel:event:parser_cache_use|PARSER_CACHE_USE]]'' event.
  
 Caching itself is handled by the cache object((''inc/cache.php'')). The key parts of that object of interest to plugins are: Caching itself is handled by the cache object((''inc/cache.php'')). The key parts of that object of interest to plugins are:
devel/caching.txt · Last modified: 2023-09-02 16:31 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki