}
$renderUrl = $this->repo->getDescriptionRenderUrl( $this->getName() );
if ( $renderUrl ) {
- if ( $this->repo->useLocalCache ) {
+ if ( $this->repo->descriptionCacheExpiry > 0 ) {
wfDebug("Attempting to get the description from the transwiki cache...");
- $key = md5($renderUrl);
+ $key = wfMemcKey( 'filedesc', 'url', md5($link));
$obj = $wgMemc->get($key);
if ($obj) {
wfDebug("success!\n");
}
wfDebug( "Fetching shared description from $renderUrl\n" );
$res = Http::get( $renderUrl );
- if ( $res && $this->repo->useLocalCache ) $wgMemc->set( $key, $res, $this->repo->localCacheExpiry );
+ if ( $res && $this->repo->descriptionCacheExpiry > 0 ) $wgMemc->set( $key, $res, $this->repo->descriptionCacheExpiry );
return $res;
} else {
return false;
// Optional settings
$this->initialCapital = true; // by default
foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription',
- 'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection',
- 'useLocalCache', 'localCacheExpiry' ) as $var )
+ 'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection', 'descriptionCacheExpiry' ) as $var )
{
if ( isset( $info[$var] ) ) {
$this->$var = $info[$var];