0
我试图用remember
方法实现laravel的缓存。那么,我该如何实现永久性呢?我尝试通过0
或null
分钟,但它不起作用。Laravel5 - Cache ::永远记住
我想缓存被存储,直到其撤销我的代码(即永远)。
感谢
我试图用remember
方法实现laravel的缓存。那么,我该如何实现永久性呢?我尝试通过0
或null
分钟,但它不起作用。Laravel5 - Cache ::永远记住
我想缓存被存储,直到其撤销我的代码(即永远)。
感谢
只需拨打Cache::forever('key','value')
我发现自己是用rememberForever
答案。像这样:
$my_data = Cache::rememberForever('key_123', function(){
//fetch from db and add to cache if not found
}
在'永远'没有'closure' –