tomschlick/laravel-http2-server-push
最新稳定版本:v0.2.1
Composer 安装命令:
composer require tomschlick/laravel-http2-server-push
包简介
A middleware package for Laravel to enable server push for your script, style, and image assets.
README 文档
README
A middleware package for Laravel 5 / Lumen to enable server push for your script, style, and image assets.
Installation
First start by adding the package to your composer.json file
composer require tomschlick/laravel-http2-server-push
Next add the service provider to your config/app.php file:
\TomSchlick\ServerPush\ServiceProvider::class,
Then add the middleware to your Http Kernel (app/Http/Kernel.php). Do so towards the end of the list.
protected $middleware = [ \TomSchlick\ServerPush\Http2ServerPushMiddleware::class, ];
Usage
Now when you enable it on a route it will automatically include the resources in your elixir /build/rev-manifest.json file.
To add a resource manually you may use pushStyle($pathOfCssFile), pushScript($pathOfJsFile), pushFont($pathOfFontFile) or pushImage($pathOfImageFile) from anywhere in your project.
统计信息
- 总下载量: 66.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 168
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-28