in $wgMemc, to further reduce hits to external storage.
Set to 0 (disabled) by default.
for page titles which shouldn't be converted on display/linking
* Lazy extraction of text chunks in Revision objects, may reduce hits to
external storage when actual text content is not used
+* Added experimental $wgRevisionCacheExpiry to cache extracted revision text
+ in $wgMemc, to further reduce hits to external storage.
+ Set to 0 (disabled) by default.
== Languages updated ==
*/
$wgDefaultExternalStore = false;
+/**
+ * Revision text may be cached in $wgMemc to reduce load on external storage
+ * servers and object extraction overhead for frequently-loaded revisions.
+ *
+ * Set to 0 to disable, or number of seconds before cache expiry.
+ */
+$wgRevisionCacheExpiry = 0;
+
/**
* list of trusted media-types and mime types.
* Use the MEDIATYPE_xxx constants to represent media types.
if ( !$argsOnly ) {
$braceCallbacks[2] = array( &$this, 'braceSubstitution' );
}
- if ( !$this->mOutputType != OT_MSG ) {
+ if ( $this->mOutputType != OT_MSG ) {
$braceCallbacks[3] = array( &$this, 'argSubstitution' );
}
if ( $braceCallbacks ) {
$fname = 'Revision::loadText';
wfProfileIn( $fname );
+ // Caching may be beneficial for massive use of external storage
+ global $wgRevisionCacheExpiry, $wgMemc, $wgDBname;
+ $key = "$wgDBname:revisiontext:textid:" . $this->getTextId();
+ if( $wgRevisionCacheExpiry ) {
+ $text = $wgMemc->get( $key );
+ if( is_string( $text ) ) {
+ wfProfileOut( $fname );
+ return $text;
+ }
+ }
+
// If we kept data for lazy extraction, use it now...
$row = $this->mTextRow;
$this->mTextRow = null;
}
$text = Revision::getRevisionText( $row );
+
+ if( $wgRevisionCacheExpiry ) {
+ $wgMemc->set( $key, $text, $wgRevisionCacheExpiry );
+ }
+
wfProfileOut( $fname );
return $text;