diff options
author | chris <chris@jalakai.co.uk> | 2006-09-25 22:12:22 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-09-25 22:12:22 +0200 |
commit | 0a69dff7134e858ffe6b95410196a8712522167b (patch) | |
tree | 13385326888bdc9c3c9eca79446cf3cd70490999 /inc/cache.php | |
parent | ce6b63d97068e71369bad95e7959d0110717bbfd (diff) | |
download | dokuwiki-0a69dff7134e858ffe6b95410196a8712522167b.tar.gz dokuwiki-0a69dff7134e858ffe6b95410196a8712522167b.zip |
amendments to previous patch updating rss & cache
rss syntax extended to include a refresh parameter
<digits><period> 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
Diffstat (limited to 'inc/cache.php')
-rw-r--r-- | inc/cache.php | 14 |
1 files changed, 9 insertions, 5 deletions
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; } } |