From: Brion Vibber Date: Fri, 5 Sep 2003 21:12:24 +0000 (+0000) Subject: Expire pages with variable replacements after 1 hour, to prevent obsolete dates and... X-Git-Tag: 1.1.0~290 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=574a71a9fc7726ee0e930a7a892de6bfa2fb4904;p=lhc%2Fweb%2Fwiklou.git Expire pages with variable replacements after 1 hour, to prevent obsolete dates and article counts on eg main page --- 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;