Added canonical url check for squid caching on view.
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 23 May 2012 17:15:48 +0000 (10:15 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 23 May 2012 17:15:48 +0000 (10:15 -0700)
* 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

index 4e37381..d43e5fb 100644 (file)
@@ -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();
        }