From: Aaron Schulz Date: Wed, 23 May 2012 17:15:48 +0000 (-0700) Subject: Added canonical url check for squid caching on view. X-Git-Tag: 1.31.0-rc.0~23524 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=eea4ecefa74f1b8e886cbcc571d2da42475a80b3;p=lhc%2Fweb%2Fwiklou.git Added canonical url check for squid caching on view. * This check is similar to the HistoryAction one. It prevents things from getting cached that do not get purged with the page is invalidated. Change-Id: Ie38ae198b173533937103d66478a9ccb5b086175 --- diff --git a/includes/actions/ViewAction.php b/includes/actions/ViewAction.php index 4e37381b54..d43e5fb3bb 100644 --- a/includes/actions/ViewAction.php +++ b/includes/actions/ViewAction.php @@ -36,7 +36,11 @@ class ViewAction extends FormlessAction { public function show(){ global $wgSquidMaxage; - $this->getOutput()->setSquidMaxage( $wgSquidMaxage ); + $request = $this->getRequest(); + if ( $request->getFullRequestURL() == $this->getTitle()->getInternalURL() ) { + $this->getOutput()->setSquidMaxage( $wgSquidMaxage ); + } + $this->page->view(); }