/**
* Sets a distributed cache.
*
* This stores a ms timestamp on the distributed cache (Jarves::setCache())
* and the actual data on the high-speed cache driver (Jarves::setFastCache()).
* This mechanism makes sure, you gain the maximum performance by using the
* fast cache driver to store the actual data and using the distributed cache driver
* to store a ms timestamp where we can check (over several jarves.cms installations)
* whether the cache is still valid or not.
*
* Use Jarves::invalidateCache($key) to invalidate this cache.
* You don't have to define the full key, instead you can pass only a part of the key.
*
* @see invalidateCache for more information.
*
* Don't mix the usage of getDistributedCache() and getCache() since this method
* stores extra values at the value, which makes getCache() returning something invalid.
*
* @param string $key
* @param mixed $value Only simple data types. Serialize your value if you have objects/arrays.
* @param int $lifeTime
*
* @return boolean
* @static
*/
public function setDistributedCache($key, $value, $lifeTime = null)
{
$timestamp = microtime(true);
$cache['data'] = $value;
$cache['timestamp'] = $timestamp;
$this->distributedCache->deleteInvalidate($key);
return $this->fastCache->set($key, $cache, $lifeTime);
}