diff --git a/boardlist.php b/boardlist.php index a85c06f..161aca8 100644 --- a/boardlist.php +++ b/boardlist.php @@ -57,10 +57,18 @@ foreach($arrDevices as $device): $arrUserFields = CUser::getFields($device['user']); + + $cacheId = md5('CIoT::isOnline_'.$device['id']); + if(CCache::check($cacheId) and CCache::getAge($cacheId) < DEVICE_ONLINE_TIME) { + $isDeviceOnline = CCache::get($cacheId); + } else { + $isDeviceOnline = CIoT::isOnline($device['id']); + CCache::write($cacheId, $isDeviceOnline); + } ?>