From 0a69dff7134e858ffe6b95410196a8712522167b Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 25 Sep 2006 22:12:22 +0200 Subject: amendments to previous patch updating rss & cache rss syntax extended to include a refresh parameter period can be d,h,m for days, hours, minutes respectively if not specified will default to 4 hours dokuwiki imposes a minimum of 10 minutes metadata now used "date valid age" (seconds) rather than "date valid end" darcs-hash:20060925201222-9b6ab-c8e6d8e40bb178295bab874fce5147ccff35fbbb.gz --- inc/cache.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 767ad8a35..a3b16d974 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -223,10 +223,6 @@ class cache_renderer extends cache_parser { if (isset($this->page)) { $metadata = p_get_metadata($this->page); - // page has an expiry time, after which it should be re-rendered (RSS feeds use this) - $page_expiry = $metadata['date']['valid']['end']; - if (!empty($page_expiry) && (time() > $page_expiry)) return false; - // check currnent link existence is consistent with cache version // first check the purgefile // - if the cache is more recent that the purgefile we know no links can have been updated @@ -255,13 +251,21 @@ class cache_renderer extends cache_parser { // page implies metadata and possibly some other dependencies if (isset($this->page)) { + $metafile = metaFN($this->page,'.meta'); if (@file_exists($metafile)) { $files[] = $metafile; // ... the page's own metadata $files[] = DOKU_INC.'inc/parser/metadata.php'; // ... the metadata renderer + + $valid = p_get_metadata($this->page, 'date valid'); + if (!empty($valid['age'])) { + $this->depends['age'] = isset($this->depends['age']) ? + min($this->depends['age'],$valid['age']) : $valid['age']; + } + } else { $this->depends['purge'] = true; // ... purging cache will generate metadata - return; + return; } } -- cgit v1.2.3