Go to the FreeLists Home Page Home Signup Help Login
 



[dokuwiki] || [Date Prev] [07-2005 Date Index] [Date Next] || [Thread Prev] [07-2005 Thread Index] [Thread Next]

[dokuwiki] Discussion: Page caching and Plugins

  • From: "Chris Smith" <chris@xxxxxxxxxxxxx>
  • To: <dokuwiki@xxxxxxxxxxxxx>
  • Date: Thu, 14 Jul 2005 00:24:12 +0100
Hello,

I wonder if the plugin interface can be extended to provide two
improvements:

(1) checking if any plugin has been added/updated since the page cache was
created in much the same way that p_cached_html() checks the cachetime
against the latest modified time for several dokuwiki files.

I think this is particularly important and should be relatively easy to
implement from existing plugins. Something along the lines of checking the
'date' returned by getinfo() method.

(2) somehow recording any plugins used (along with some plugin supplied key
data) in page parsing/rendering and in the process of determining whether or
not the page should be served from the cache query those plugins to see if
the cache file can be used.

I think this might be more difficult, but would be very useful for plugins
that include data external to the current wiki page.  It would give those
plugins an opportunity to verify the currency of the data used when the
cached version was prepared.

It is possible now for the plugin to force no caching on the page.  That is
an inelegant solution and it loses the benefits of caching for what is
probably the majority of page views when the cached version would be
sufficient.

I think points for discussion are,
- how dokuwiki can record which plugins were involved in preparation of the
cached version and
- how the plugins can provide information that they can use later to
determine page currency.

Neat and elegant solutions to complex problems aren't really my thing :)

However, I would think that points to two extra methods for plugins.
- after the page is prepared, for each plugin used, dokuwiki calls a method
to discover if the plugin wishes to put any limits on page caching.  The
plug in returns a variable containing the data it needs to establish page
currency or false/null for no restrictions.
- when deciding if a cached version of a page can be used, dokuwiki calls a
method with the previously supplied data to get a true/false answer.

I suspect most plugins could ignore these two methods, happy with the values
provided by the methods of the parent class.  Those plugins like include &
source would supply overriding methods.

I am not sure of an appropriate method for dokuwiki to store the data.  A
third cache file seems excessive.  Could it be added to one of the other
two?

Any other thoughts or ideas?

Cheers,

Chris




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




[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.