public static function listExtensionActivatedTags() {
return ObjectCache::getMainWANInstance()->getWithSetCallback(
wfMemcKey( 'active-tags' ),
- 300,
+ WANObjectCache::TTL_MINUTE * 5,
function ( $oldValue, &$ttl, array &$setOpts ) {
$setOpts += Database::getCacheSetOptions( wfGetDB( DB_SLAVE ) );
},
[
'checkKeys' => [ wfMemcKey( 'active-tags' ) ],
- 'lockTSE' => 300,
- 'pcTTL' => 30
+ 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
+ 'pcTTL' => WANObjectCache::TTL_PROC_LONG
]
);
}
return ObjectCache::getMainWANInstance()->getWithSetCallback(
wfMemcKey( 'valid-tags-db' ),
- 300,
+ WANObjectCache::TTL_MINUTE * 5,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $fname ) {
$dbr = wfGetDB( DB_SLAVE );
},
[
'checkKeys' => [ wfMemcKey( 'valid-tags-db' ) ],
- 'lockTSE' => 300,
- 'pcTTL' => 30
+ 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
+ 'pcTTL' => WANObjectCache::TTL_PROC_LONG
]
);
}
public static function listExtensionDefinedTags() {
return ObjectCache::getMainWANInstance()->getWithSetCallback(
wfMemcKey( 'valid-tags-hook' ),
- 300,
+ WANObjectCache::TTL_MINUTE * 5,
function ( $oldValue, &$ttl, array &$setOpts ) {
$setOpts += Database::getCacheSetOptions( wfGetDB( DB_SLAVE ) );
},
[
'checkKeys' => [ wfMemcKey( 'valid-tags-hook' ) ],
- 'lockTSE' => 300,
- 'pcTTL' => 30
+ 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
+ 'pcTTL' => WANObjectCache::TTL_PROC_LONG
]
);
}
$fname = __METHOD__;
return ObjectCache::getMainWANInstance()->getWithSetCallback(
wfMemcKey( 'change-tag-statistics' ),
- 300,
+ WANObjectCache::TTL_MINUTE * 5,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $fname ) {
$dbr = wfGetDB( DB_SLAVE, 'vslow' );
},
[
'checkKeys' => [ wfMemcKey( 'change-tag-statistics' ) ],
- 'lockTSE' => 300,
- 'pcTTL' => 30
+ 'lockTSE' => WANObjectCache::TTL_MINUTE * 5,
+ 'pcTTL' => WANObjectCache::TTL_PROC_LONG
]
);
}
* @since 1.27
*/
interface IExpiringStore {
-
// Constants for TTL values, in seconds
const TTL_MINUTE = 60;
const TTL_HOUR = 3600;
const TTL_MONTH = 2592000; // 30 * 24 * 3600
const TTL_YEAR = 31536000; // 365 * 24 * 3600
+ // Shorthand process cache TTLs (useful for web requests and CLI mode)
+ const TTL_PROC_SHORT = 3; // reasonably strict cache time that last the life of quick requests
+ const TTL_PROC_LONG = 30; // loose cache time that can survive slow web requests
+
const TTL_INDEFINITE = 0;
}