更改cache.php中cache_driver值为memcached。

use Cache; #控制器中使用缓存
public function memcache(){
Cache::put('memcache','hello,world',1); #写入缓存(key,value,time)
dd(Cache::get('memcache')); #获取缓存
}
时间单位为分钟

use Cache; #控制器中使用缓存
public function memcache(){
Cache::put('memcache','hello,world',1); #写入缓存(key,value,time)
dd(Cache::get('memcache')); #获取缓存
}
本文标题:laravel操作memcache笔记!
本文链接:https://www.haomeiwen.com/subject/ezsjsftx.html
网友评论