Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2716,7 +2716,7 @@ |
2717 | 2717 | if ( !$argsOnly ) { |
2718 | 2718 | $braceCallbacks[2] = array( &$this, 'braceSubstitution' ); |
2719 | 2719 | } |
2720 | | - if ( !$this->mOutputType != OT_MSG ) { |
| 2720 | + if ( $this->mOutputType != OT_MSG ) { |
2721 | 2721 | $braceCallbacks[3] = array( &$this, 'argSubstitution' ); |
2722 | 2722 | } |
2723 | 2723 | if ( $braceCallbacks ) { |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -672,6 +672,17 @@ |
673 | 673 | $fname = 'Revision::loadText'; |
674 | 674 | wfProfileIn( $fname ); |
675 | 675 | |
| 676 | + // Caching may be beneficial for massive use of external storage |
| 677 | + global $wgRevisionCacheExpiry, $wgMemc, $wgDBname; |
| 678 | + $key = "$wgDBname:revisiontext:textid:" . $this->getTextId(); |
| 679 | + if( $wgRevisionCacheExpiry ) { |
| 680 | + $text = $wgMemc->get( $key ); |
| 681 | + if( is_string( $text ) ) { |
| 682 | + wfProfileOut( $fname ); |
| 683 | + return $text; |
| 684 | + } |
| 685 | + } |
| 686 | + |
676 | 687 | // If we kept data for lazy extraction, use it now... |
677 | 688 | $row = $this->mTextRow; |
678 | 689 | $this->mTextRow = null; |
— | — | @@ -695,6 +706,11 @@ |
696 | 707 | } |
697 | 708 | |
698 | 709 | $text = Revision::getRevisionText( $row ); |
| 710 | + |
| 711 | + if( $wgRevisionCacheExpiry ) { |
| 712 | + $wgMemc->set( $key, $text, $wgRevisionCacheExpiry ); |
| 713 | + } |
| 714 | + |
699 | 715 | wfProfileOut( $fname ); |
700 | 716 | |
701 | 717 | return $text; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2071,6 +2071,14 @@ |
2072 | 2072 | $wgDefaultExternalStore = false; |
2073 | 2073 | |
2074 | 2074 | /** |
| 2075 | + * Revision text may be cached in $wgMemc to reduce load on external storage |
| 2076 | + * servers and object extraction overhead for frequently-loaded revisions. |
| 2077 | + * |
| 2078 | + * Set to 0 to disable, or number of seconds before cache expiry. |
| 2079 | + */ |
| 2080 | +$wgRevisionCacheExpiry = 0; |
| 2081 | + |
| 2082 | +/** |
2075 | 2083 | * list of trusted media-types and mime types. |
2076 | 2084 | * Use the MEDIATYPE_xxx constants to represent media types. |
2077 | 2085 | * This list is used by Image::isSafeFile |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -210,6 +210,9 @@ |
211 | 211 | for page titles which shouldn't be converted on display/linking |
212 | 212 | * Lazy extraction of text chunks in Revision objects, may reduce hits to |
213 | 213 | external storage when actual text content is not used |
| 214 | +* Added experimental $wgRevisionCacheExpiry to cache extracted revision text |
| 215 | + in $wgMemc, to further reduce hits to external storage. |
| 216 | + Set to 0 (disabled) by default. |
214 | 217 | |
215 | 218 | |
216 | 219 | == Languages updated == |