diff options
author | Michael Hamann <michael@content-space.de> | 2011-05-08 11:44:12 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2011-05-08 12:16:48 +0200 |
commit | 65aa8490874917620bd9a9a773cd0fb7621afb41 (patch) | |
tree | 7dd3428e26c9277d1169e6eeb6616d7163a9282f /inc/template.php | |
parent | 67c15ecea77ff971dcb554de77cf1c25de1140a0 (diff) | |
download | rpg-65aa8490874917620bd9a9a773cd0fb7621afb41.tar.gz rpg-65aa8490874917620bd9a9a773cd0fb7621afb41.tar.bz2 |
Add more render/cache logic to the metadata code
This adds a new rendering limit of currently 5 pages to the
p_get_metadata function. This means that in one request not more than 3
pages will be parsed/rendered. Pages for which the cache can be used
aren't counted. This should make the new cache modes safe to use and
should provide backwards compatibility while keeping the advantage of
rendering metadata on demand (i.e. imagine one included page out of 10
is updated, then the metadata for that page can be rendered, but when
you request a purge of the cache not 10 pages are rendered).
In this commit most of the changes to the p_get_first_heading function
are reverted and the title index is no longer used. This makes the first
heading functionality no longer depends on the search index of DokuWiki.
Maybe it can be added again later when the indexer provides a proper API
for getting metadata values for all or selected pages. The performance
of the p_get_first_heading function should be almost back to the
performance in Anteater as the simple cache of p_get_metadata is used
and also the limit of p_get_metadata is of course applied.
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/template.php b/inc/template.php index e028fe39c..99ab8f35f 100644 --- a/inc/template.php +++ b/inc/template.php @@ -155,7 +155,7 @@ function tpl_toc($return=false){ $toc = $TOC; }elseif(($ACT == 'show' || substr($ACT,0,6) == 'export') && !$REV && $INFO['exists']){ // get TOC from metadata, render if neccessary - $meta = p_get_metadata($ID, false, true); + $meta = p_get_metadata($ID, false, METADATA_RENDER_USING_CACHE); if(isset($meta['internal']['toc'])){ $tocok = $meta['internal']['toc']; }else{ |