From a257b0bd427ca5a7eb636d95f98aca831ec075b5 Mon Sep 17 00:00:00 2001 From: Martin Doucha Date: Thu, 14 Jun 2012 16:34:19 +0200 Subject: Cache that has exactly the same age as a dependency may be stale --- inc/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index ff78e37ae..e598baa47 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? } } -- cgit v1.2.3 From 7d01a0eac854c623a74ff7936d5eba9413aefe79 Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Wed, 27 Jun 2012 02:48:49 -0400 Subject: more INPUT wrapper uses: cache purge, sectok, getID --- inc/cache.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index ff78e37ae..204c6f006 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -84,7 +84,8 @@ class cache { * it should only overwrite a dependency when the new value is more stringent than the old */ function _addDependencies() { - if (isset($_REQUEST['purge'])) $this->depends['purge'] = true; // purge requested + global $INPUT; + if ($INPUT->has('purge')) $this->depends['purge'] = true; // purge requested } /** -- cgit v1.2.3 From 2302d6be19de4e244b16d43628844c7d9df51ffc Mon Sep 17 00:00:00 2001 From: Martin Doucha Date: Fri, 6 Jul 2012 14:15:59 +0200 Subject: Make metadata cache dependency non-strict --- inc/cache.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index e0d08c971..5eac94934 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -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']) ? -- cgit v1.2.3