lilocon / laravel-router-cache
Installs: 39
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/lilocon/laravel-router-cache
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
Requires (Dev)
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2020-01-24 17:10:38 UTC
README
路由缓存 通过apcu缓存特定路由,优化性能
安装
composer require lilocon/laravel-router-cache
配置
注册 ServiceProvider(5.5+ 版本不需要手动注册):
\Lilocon\RouterCache\RouterCacheServiceProvider::class,
使用
在需要缓存的路由上加一个中间件 router.cache
Route::any('/api', 'ApiController@api')->name('api')->middleware('router.cache');
注意:只有命名的路由才会被缓存
注意:只有关闭debug才会生效
License
MIT