Index: trunk/phase3/includes/resourceloader/ResourceLoader.php |
— | — | @@ -119,8 +119,6 @@ |
120 | 120 | * @return String: Filtered data |
121 | 121 | */ |
122 | 122 | protected function filter( $filter, $data ) { |
123 | | - global $wgMemc; |
124 | | - |
125 | 123 | wfProfileIn( __METHOD__ ); |
126 | 124 | |
127 | 125 | // For empty/whitespace-only data or for unknown filters, don't perform |
— | — | @@ -132,9 +130,11 @@ |
133 | 131 | return $data; |
134 | 132 | } |
135 | 133 | |
136 | | - // Try for Memcached hit |
| 134 | + // Try for cache hit |
| 135 | + // Use CACHE_ANYTHING since filtering is very slow compared to DB queries |
137 | 136 | $key = wfMemcKey( 'resourceloader', 'filter', $filter, md5( $data ) ); |
138 | | - $cacheEntry = $wgMemc->get( $key ); |
| 137 | + $cache = wfGetCache( CACHE_ANYTHING ); |
| 138 | + $cacheEntry = $cache->get( $key ); |
139 | 139 | if ( is_string( $cacheEntry ) ) { |
140 | 140 | wfProfileOut( __METHOD__ ); |
141 | 141 | return $cacheEntry; |
— | — | @@ -159,7 +159,7 @@ |
160 | 160 | } |
161 | 161 | |
162 | 162 | // Save filtered text to Memcached |
163 | | - $wgMemc->set( $key, $result ); |
| 163 | + $cache->set( $key, $result ); |
164 | 164 | |
165 | 165 | wfProfileOut( __METHOD__ ); |
166 | 166 | |