We have created some custom pages, where we are forced to run a lot of sql statements. The data can be cached for a couple of days or untill we clear the cache.
My prolem is it don't store the cache. Everytime the funciton Cache::isStored returns false.
$cache_id = "test";
if (Cache::isStored($cache_id)) {
/// Query data
Cache::store($cache_id, $data);
}
$data = Cache::retrieve($cache_id);
echo json_encode($data);
I think i'm using the cache function wrong. But I can't seem to find any documentation for it.
Can anybody help either with documentation or some example code
if (!Cache::isStored($cache_id))
and then to store and save data, because like you said it always returns false. – Cortico