From 574a71a9fc7726ee0e930a7a892de6bfa2fb4904 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 5 Sep 2003 21:12:24 +0000 Subject: [PATCH] Expire pages with variable replacements after 1 hour, to prevent obsolete dates and article counts on eg main page --- includes/Article.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Article.php b/includes/Article.php index a7ed414e07..5df7f163f5 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1063,8 +1063,14 @@ class Article { function tryFileCache() { if($this->isFileCacheable()) { + $touched = $this->mTouched; + if( strpos( $this->mContent, "{{" ) !== false ) { + # Expire pages with variable replacements in an hour + $expire = wfUnix2Timestamp( time() - 3600 ); + $touched = max( $expire, $touched ); + } $cache = new CacheManager( $this->mTitle ); - if($cache->isFileCacheGood( $this->mTouched )) { + if($cache->isFileCacheGood( $touched )) { wfDebug( " tryFileCache() - about to load\n" ); $cache->loadFromFileCache(); exit; -- 2.20.1