The check to WikiPage::getTouched will load the latest revision data, which is
not ideal for performance. In a quick test using ab -c 100 -n 1000 and without
MemCached enabled, the request rate for plain GET requests drops slightly from
108 to 104 req/second. As described in my comment
https://bugzilla.wikimedia.org/show_bug.cgi?id=10023#c9, this could certainly be
improved on. Overall, a few unmodified responses should still make the
server-side performance impact of this patch positive, while improving
client-side performance considerably for unmodified content.
return;
}
+ if ( $this->getOutput()->checkLastModified( $this->page->getTouched() ) ) {
+ return; // Client cache fresh and headers sent, nothing more to do.
+ }
+
# special case for 'generated' raw things: user css/js
# This is deprecated and will only return empty content
$gen = $request->getVal( 'gen' );