/**
* @brief Class for storing data for a short time
*/
-class Cache
+class Cache extends \Friendica\BaseObject
{
const MONTH = 0;
const WEEK = 1;
*/
public static function get($key)
{
- return self::getDriver()->get($key);
+ $time = microtime(true);
+
+ $return = self::getDriver()->get($key);
+
+ self::getApp()->save_timestamp($time, 'cache');
+
+ return $return;
}
/**
*/
public static function set($key, $value, $duration = self::MONTH)
{
- return self::getDriver()->set($key, $value, $duration);
+ $time = microtime(true);
+
+ $return = self::getDriver()->set($key, $value, $duration);
+
+ self::getApp()->save_timestamp($time, 'cache_write');
+
+ return $return;
}
/**