mirror of
https://github.com/friendica/friendica
synced 2024-11-19 16:23:40 +00:00
Add cache timing points
This commit is contained in:
parent
3df34d33d5
commit
4954c4b9aa
1 changed files with 15 additions and 3 deletions
|
@ -10,7 +10,7 @@ use Friendica\Core\Config;
|
||||||
/**
|
/**
|
||||||
* @brief Class for storing data for a short time
|
* @brief Class for storing data for a short time
|
||||||
*/
|
*/
|
||||||
class Cache
|
class Cache extends \Friendica\BaseObject
|
||||||
{
|
{
|
||||||
const MONTH = 0;
|
const MONTH = 0;
|
||||||
const WEEK = 1;
|
const WEEK = 1;
|
||||||
|
@ -108,7 +108,13 @@ class Cache
|
||||||
*/
|
*/
|
||||||
public static function get($key)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -124,7 +130,13 @@ class Cache
|
||||||
*/
|
*/
|
||||||
public static function set($key, $value, $duration = self::MONTH)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue