[dokuwiki] Re: Cache Expiry Standardisation

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 30 Mar 2006 11:49:15 +0100

Chris Smith wrote:

I realise I am being lazy and the answers to the above two questions are probably maybe and yes, in which case I should probably propose something so cache management can be centralised. Maybe someone else has some ideas, inspiration and time.
This inspired a whole lot of comment. :-)

I have done some checking. Dokuwiki does a lot of filemtime checks in order to deliver a page, its css and its js. In addition to checking the filemtime of the particular file, Dokuwiki also checks:

for renderer instructions:  4 files
for xhtml:  5 files
for js: 10 + each plugin styles.css (not including the two for write option)
for css: 4 + each template css file + each plugin css file

Is this a lot of checks? Will it make any significant difference to reduce them?
Say to have a cache checking value in config, so developers could have it set it to exhaustive and stable wiki's could have it set to minimal?


Putting aside the template CSS files which are there for user change, in a stable wiki how often will any of the other files get changed independently of a dokuwiki upgrade?

I think not very often. In which case, I'd reckon the number of checks for a stable wiki could be reduced to three files:
- dokuwiki.php (above four all check this file and it will be updated with a dokuwiki upgrade).
- local.php (above four all check this file, and it represents user config changes)
- new file, $conf['data']/meta/<thiscache>.cache


A cacheutils function ... cache_expire($cache_name) would provide a defined interface for expiring caches.

To expire all caches, it will touch local.php
To expire a specific cache, it will touch $conf['data']/meta/$cache_name.cache


It looks like the js handler sends headers which tells the browser not to cache css & js. Might it be better to allow the browser to cache these files, or at least for this to be configurable - again, for a stable wiki there should not be a problem with the browser caching the CSS or 90% of the JS. That may mean split the js files into two, browser cacheable and browser not cacheable?

Cheers,

Chris




-- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: