Nerf the APC cache on SaaS
* We have multiple webservers on SaaS so we need a distributed data cache like memcached. * Fixes CC-5671: Live streaming: UI won't update connection status unless reload apache2
This commit is contained in:
parent
a0cae1d8f3
commit
03015a6b69
|
@ -2,31 +2,37 @@
|
||||||
|
|
||||||
class Cache
|
class Cache
|
||||||
{
|
{
|
||||||
|
|
||||||
private function createCacheKey($key, $isUserValue, $userId = null) {
|
private function createCacheKey($key, $isUserValue, $userId = null) {
|
||||||
|
|
||||||
$CC_CONFIG = Config::getConfig();
|
$CC_CONFIG = Config::getConfig();
|
||||||
$a = $CC_CONFIG["apiKey"][0];
|
$a = $CC_CONFIG["apiKey"][0];
|
||||||
|
|
||||||
if ($isUserValue) {
|
if ($isUserValue) {
|
||||||
$cacheKey = "{$key}{$userId}{$a}";
|
$cacheKey = "{$key}{$userId}{$a}";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$cacheKey = "{$key}{$a}";
|
$cacheKey = "{$key}{$a}";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $cacheKey;
|
return $cacheKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store($key, $value, $isUserValue, $userId = null) {
|
public function store($key, $value, $isUserValue, $userId = null) {
|
||||||
|
|
||||||
$cacheKey = self::createCacheKey($key, $userId);
|
$cacheKey = self::createCacheKey($key, $userId);
|
||||||
return apc_store($cacheKey, $value);
|
//XXX: Disabling APC on SaaS because it turns out we have multiple webservers
|
||||||
}
|
// running, which means we have to use a distributed data cache like memcached.
|
||||||
|
//return apc_store($cacheKey, $value);
|
||||||
public function fetch($key, $isUserValue, $userId = null) {
|
return false;
|
||||||
|
}
|
||||||
$cacheKey = self::createCacheKey($key, $isUserValue, $userId);
|
|
||||||
return apc_fetch($cacheKey);
|
public function fetch($key, $isUserValue, $userId = null) {
|
||||||
}
|
|
||||||
}
|
$cacheKey = self::createCacheKey($key, $isUserValue, $userId);
|
||||||
|
//XXX: Disabling APC on SaaS because it turns out we have multiple webservers
|
||||||
|
// running, which means we have to use a distributed data cache like memcached.
|
||||||
|
//return apc_fetch($cacheKey);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue