r108529 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108528‎ | r108529 | r108530 >
Date:18:16, 10 January 2012
Author:gwicke
Status:ok
Tags:
Comment:
Support If-modified-since for RawPage, fixes bug #10023.

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.
Modified paths:
  • /trunk/phase3/includes/actions/RawAction.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/actions/RawAction.php
@@ -42,6 +42,10 @@
4343 return;
4444 }
4545
 46+ if ( $this->getOutput()->checkLastModified( $this->page->getTouched() ) ) {
 47+ return; // Client cache fresh and headers sent, nothing more to do.
 48+ }
 49+
4650 # special case for 'generated' raw things: user css/js
4751 # This is deprecated and will only return empty content
4852 $gen = $request->getVal( 'gen' );

Status & tagging log