CacheLocal vs Cache. One doubt and a suggestion
Permalink
Hi
I'm not clear about the difference between Cache and CacheLocal. AFAIK, CacheLocal works in memory, so it is faster than regular Cache. But, is CacheLocal stored in the filesystem too, or it disappears when the scripts finish? I can see there is no CacheLocal::Flush, so I think that it is volatile.
Can we reuse CacheLocal for later tasks? For instance:
Thanks in advance.
I'm not clear about the difference between Cache and CacheLocal. AFAIK, CacheLocal works in memory, so it is faster than regular Cache. But, is CacheLocal stored in the filesystem too, or it disappears when the scripts finish? I can see there is no CacheLocal::Flush, so I think that it is volatile.
Can we reuse CacheLocal for later tasks? For instance:
function setSuperFastCache($mydataGroup, $myDataId, $myRecordset){ CacheLocal::set($mydataGroup, $myDataId, $myRecordset); Cache::::set($mydataGroup, $myDataId, $myRecordset); } function getSuperFastCache ($mydataGroup, $myDataId){ $data = CacheLocal::get($mydataGroup, $myDataId); if ($data){ return $data; } else { return Cache::get($mydataGroup, $myDataId); }
Thanks in advance.