добавлено кэширование
This commit is contained in:
1 parent
fb1d3f1d85
commit
f87b29c086
2 files changed
+9
-1
No files matched your search
@@ -190,6 +190,7 @@ class CDB
|
|||||||
|
|
||||||
$endTime = microtime(true);
|
$endTime = microtime(true);
|
||||||
self::$workingTime += ($endTime - $startTime);
|
self::$workingTime += ($endTime - $startTime);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,14 @@
|
|||||||
require_once __DIR__ . '/inc/bootstrap.php';
|
require_once __DIR__ . '/inc/bootstrap.php';
|
||||||
require_once __DIR__ . '/inc/header.php';
|
require_once __DIR__ . '/inc/header.php';
|
||||||
|
|
||||||
$arSensors = CIoT::getDallasArrData($USER['deviceId']);
|
$cacheId = md5('CIoT::getDallasArrData_'.$USER['deviceId']);
|
||||||
|
if(CCache::checkCache($cacheId)) {
|
||||||
|
$arSensors = CCache::getCache($cacheId);
|
||||||
|
} else {
|
||||||
|
$arSensors = CIoT::getDallasArrData($USER['deviceId']);
|
||||||
|
CCache::writeCache($cacheId, $arSensors);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- Page JS Code -->
|
<!-- Page JS Code -->
|
||||||
|
|||||||
Reference in new issue
Block a user