Move Article checkLastModified() up to MediaWiki::performRequest
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 77ac76a..2a00900 100644 (file)
@@ -286,6 +286,16 @@ class MediaWiki {
                                // may still be a wikipage redirect to another article or URL.
                                $article = $this->initializeArticle();
                                if ( is_object( $article ) ) {
+                                       $url = $request->getFullRequestURL(); // requested URL
+                                       if (
+                                               $request->getMethod() === 'GET' &&
+                                               $url === $article->getTitle()->getCanonicalURL() &&
+                                               $article->checkTouched() &&
+                                               $output->checkLastModified( $article->getTouched() )
+                                       ) {
+                                               wfDebug( __METHOD__ . ": done 304\n" );
+                                               return;
+                                       }
                                        $this->performAction( $article, $requestTitle );
                                } elseif ( is_string( $article ) ) {
                                        $output->redirect( $article );