Optimisation no 5: cache events totals for 5min + sql optimization

This commit is contained in:
jokob-sk
2022-08-05 16:52:59 +10:00
parent 75c901a111
commit 8650c68801
3 changed files with 64 additions and 54 deletions

View File

@@ -811,21 +811,5 @@ function getDeviceCondition ($deviceStatus) {
}
}
//------------------------------------------------------------------------------
// Simple cookie cache
//------------------------------------------------------------------------------
function getCache($key) {
if( isset($_COOKIE[$key]))
{
return $_COOKIE[$key];
}else
{
return "";
}
}
function setCache($key, $value) {
setcookie($key, $value, time()+300, "/","", 0); // 5min cache
}
?>