具体如下:
1. Laravel为各种不同的缓存系统提供了一致的API,支持的缓存有File、Memcached和Redis等
2. 主要方法
put()、add()、forever()、has()、get()、pull()、forget()
3. 配置文件路径 /config/cache.php
4. 添加路由
Route::get('/cache1', 'HomeController@cache1');
Route::get('/cache2', 'HomeController@cache2');5. 添加缓存
public function cache1(){
Cache::put('key1','val1',10);
}由于这里我们就使用默认的文件缓存,那么执行该方法后,在storage下会生成新的缓存文件,如下图所示

6. 其他操作