From eea4ecefa74f1b8e886cbcc571d2da42475a80b3 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 23 May 2012 10:15:48 -0700 Subject: [PATCH] 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 --- includes/actions/ViewAction.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); } -- 2.20.1