From df67210bdd9e0b542acb1127598a9b1f2c3a7311 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 9 Nov 2005 10:58:54 +0000 Subject: [PATCH] * Allow parser cache on redirect targets --- RELEASE-NOTES | 1 + includes/Article.php | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d80b880f87..8961b7c8fe 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -217,6 +217,7 @@ fully support the editing toolbar, but was found to be too confusing. * Forbid usernames that can be interpreted as titles with namespaces, as that leads to hard-to-manage names. * (bug 2721) Regression: Use European number separators for vi: wikis +* Allow parser cache on redirect targets === Caveats === diff --git a/includes/Article.php b/includes/Article.php index 48d31d03e2..eb131c613c 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -756,8 +756,13 @@ class Article { $redir = $sk->makeKnownLink( $this->mRedirectedFrom, '', 'redirect=no' ); $s = wfMsg( 'redirectedfrom', $redir ); $wgOut->setSubtitle( $s ); - # Can't cache redirects - $pcache = false; + + // Check the parser cache again, for the target page + if( $pcache ) { + if( $wgOut->tryParserCache( $this, $wgUser ) ) { + $outputDone = true; + } + } $wasRedirected = true; } } elseif ( !empty( $rdfrom ) ) { @@ -770,7 +775,8 @@ class Article { $wasRedirected = true; } } - + } + if( !$outputDone ) { # wrap user css and user js in pre and don't parse # XXX: use $this->mTitle->usCssJsSubpage() when php is fixed/ a workaround is found if ( -- 2.20.1