summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-07-08 20:27:22 +0200
committerMichael Hamann <michael@content-space.de>2012-07-08 20:27:22 +0200
commit79b37bb895365dee4b0c0095d185f360f2512113 (patch)
treecee1a37f6fb4ee19cdb88eb526f1e8358c00561f /inc
parent3d6feb16238ee969cb2ba14a592124052f0c4bc2 (diff)
parent4538a8a6a37ec274aa15e70c45b6fd0c6c652563 (diff)
downloadrpg-79b37bb895365dee4b0c0095d185f360f2512113.tar.gz
rpg-79b37bb895365dee4b0c0095d185f360f2512113.tar.bz2
Merge remote-tracking branch 'nextghost/master'
This changes the caching system to expire caches when the last modified time of a dependency is equal to the cache file except for the meta file where the old check is kept in order to avoid additional renderer calls and possible circular dependencies. This avoids stale cache files but means that the parser and renderer could now be called more than once after an edit but we currently don't have a better fix for that.
Diffstat (limited to 'inc')
-rw-r--r--inc/cache.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/inc/cache.php b/inc/cache.php
index 204c6f006..5eac94934 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -69,7 +69,7 @@ class cache {
if (!empty($this->depends['files'])) {
foreach ($this->depends['files'] as $file) {
- if ($this->_time < @filemtime($file)) return false; // cache older than files it depends on?
+ if ($this->_time <= @filemtime($file)) return false; // cache older than files it depends on?
}
}
@@ -207,6 +207,8 @@ class cache_renderer extends cache_parser {
return true;
}
+ if ($this->_time < @filemtime(metaFN($this->page,'.meta'))) return false; // meta cache older than file it depends on?
+
// check current link existence is consistent with cache version
// first check the purgefile
// - if the cache is more recent than the purgefile we know no links can have been updated
@@ -239,9 +241,6 @@ class cache_renderer extends cache_parser {
// page implies metadata and possibly some other dependencies
if (isset($this->page)) {
- $metafile = metaFN($this->page,'.meta');
- $files[] = $metafile; // ... the page's own metadata
-
$valid = p_get_metadata($this->page, 'date valid'); // for xhtml this will render the metadata if needed
if (!empty($valid['age'])) {
$this->depends['age'] = isset($this->depends['age']) ?