expand cache

This commit is contained in:
CHIEFSOFT\ameye
2023-11-08 17:04:50 -05:00
parent fa1642dfec
commit f5f5c48dc9
2 changed files with 11 additions and 2 deletions
+2 -2
View File
@@ -51,13 +51,13 @@ abstract class BaseController extends Controller
// E.g.: $this->session = \Config\Services::session();
}
public function saveCache($cacheKey,$data){
public function saveCache($cacheKey,$data,$timeLine=5000){
$cacheKey = CACHE_DOMAIN."-".$cacheKey;
// $cache = \Config\Services::cache();
if (! $foo = cache($cacheKey)) {
// echo 'Saving to the cache!<br>';
// cache()->save($cacheKey, $this->data_stringify($data), 3000);
cache()->save($cacheKey, serialize($data), 3000);
cache()->save($cacheKey, serialize($data), $timeLine);
//serialize
}