10/05
2018
Laravel中间件-Response缓存
composer require flc/laravel-middleware-cache-response
\app\Http\Kernel.php
文件中$routeMiddleware
增加:, (*2)
<?php 'cache.response' => \Flc\Laravel\Http\Middleware\CacheResponse::class, // cache.response 命名随意,你开心就好
<?php Route::get('/', function () { return view('welcome'); })->middleware('cache.response'); Route::get('/', function () { return view('welcome'); })->middleware('cache.response:20'); // 指定缓存时间20分钟
缓存规则, (*3)
Headers, (*4)
X-Cache:Missed X-Cache-Expires:2018-03-29 15:08:29 CST X-Cache-Key:6c9b19774e2c304a42d200f314d8c80b
status
、header
的支持如果你觉得本扩展对你有帮助,请捐赠以表支持,谢谢~~, (*5)
微信, (*6) |
支付宝, (*7) |