r37008 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37007‎ | r37008 | r37009 >
Date:21:12, 3 July 2008
Author:demon
Status:old
Tags:
Comment:
Revert thumb caching because it wasn't actually caching what I thought it was.
Modified paths:
  • /trunk/phase3/includes/filerepo/ForeignAPIFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php
@@ -31,26 +31,13 @@
3232 }
3333
3434 function transform( $params, $flags = 0 ) {
35 - global $wgMemc;
3635 $thumbUrl = $this->repo->getThumbUrl(
3736 $this->getName(),
3837 isset( $params['width'] ) ? $params['width'] : -1,
3938 isset( $params['height'] ) ? $params['height'] : -1 );
4039 if( $thumbUrl ) {
41 - if ( $this->repo->useLocalCache ) {
42 - wfDebug("Attempting to get the thumb from the cache...");
43 - $key = md5($thumbUrl);
44 - $obj = $wgMemc->get($key);
45 - if ($obj) {
46 - wfDebug("success!\n");
47 - return $obj;
48 - }
49 - wfDebug("miss\n");
50 - }
51 - $res = $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params );;
52 - if ( $res && $this->repo->useLocalCache ) $wgMemc->set( $key, $res, $this->repo->localCacheExpiry );
5340 wfDebug( __METHOD__ . " got remote thumb $thumbUrl\n" );
54 - return $res;
 41+ return $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params );;
5542 }
5643 return false;
5744 }

Status & tagging log