[dokuwiki] Caching changes
- From: Chris Smith <chris@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Sun, 24 Sep 2006 12:08:20 +0100
Hi again :)
(a) Bug when forcing purge via query string
Two calls are made to p_cached_instructions() when the renderer cache is
not valid. The purge query string prevents any cache use, resulting in
the full parsing of the wiki page twice and quite slow page generation.
I haven't been able to come up with a neat way of handling this -
excepting setting a global flag. How often is PURGE used? Is it worth
coming up with a solution?
Technical Explanation:
----------------------
First, the new cache code forces regeneration of metadata when ever the
renderer (xhtml) cache is regenerated. This keeps the metadata's
knowledge of internal link (exists / not exists) in line with that of
the rendered page (allowing the metadata link information to be used in
determing cache validity).
Second, the normal call to p_cached_instructions, is made by
p_cached_output when it retrieves the instructions for use in rendering
the page.
Also its important that the metadata is generated before the cached
rendered page as metadata is a dependency of the cache.
(b) cachetime setting(Max age for cache)
Dokuwiki's cache code should now be 100% internally consistent - ie only
by making external changes can the cache use code make incorrect
decisions on cache validity.
Since serving a page from cache is much faster than regenerating it ...
Can the default setting be increased?
Can it be removed entirely?
Technical Explanation
---------------------
The new cache code is pretty extensive in its checking the dependencies
of the page to determine whether or not the cached version is valid.
- all the parser files are checked.
- the configuration files are checked ( this accounts for plugins, as
the plugin manager touches the local config settings file when a change
(install, remove, enable, disable) is made.
- internal link existence consistency is checked (via metadata).
- syntax plugins can add additional dependencies and checks if they
require them
Unless I have missed something -- quite probable :-) -- only external
changes (e.g. manual plugin install/delete) can defeat the cache use
logic.
However, if someone is making external changes, they really should be
expiring the cache manually too.
(c) caching common actions for anonymous visitors
It is technically feasible to cache the output generated for common
actions such as index, recent changes and old revisions. The tricky
dependency that all these actions have is visitor access level, which
probably makes caching only reasonable for anonymous visitors. Groups
could also be handled IF there are no user based ACL entries.
I think this would be pretty easy to implement through the cache object,
but is it worthwhile (for the next release :-))?
Cheers,
Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- Follow-Ups:
- [dokuwiki] Re: Caching changes
- From: Andreas Gohr
Other related posts:
- » [dokuwiki] Caching changes
- » [dokuwiki] Re: Caching changes
(a) Bug when forcing purge via query string
- [dokuwiki] Re: Caching changes
- From: Andreas Gohr