$data = [
'ti
'content' => $res[0]['content'],
'start_time' => $res[0]['start_time'],
'promulgator' => $res[0]['promulgator'],
];
S(md5($url), $data, array('type'=>'file','length'=>100,'expire'=>60));
$res_data = S(md5($url));
return $res_data;
}
将$data里的数据以文件的形式进行缓存
在下面的方法里读取数据 为什么读取不到呢??
public function notif () {
$res_cache_data = S(md5($url));
if ($res_cache_data) {
$res = $res_cache_data;
} else {
$res = $this->publicNotif($url);
}
}
最佳答案