LaravelPackages.net
Acme Inc.
Toggle sidebar
tomschlick/laravel-http2-server-push

A middleware package for Laravel to enable server push for your script, style, and image assets.

67.672
163
v0.2.1
About tomschlick/laravel-http2-server-push

tomschlick/laravel-http2-server-push is a Laravel package for a middleware package for laravel to enable server push for your script, style, and image assets.. It currently has 163 GitHub stars and 67.672 downloads on Packagist (latest version v0.2.1). Install it with composer require tomschlick/laravel-http2-server-push. Discover more Laravel packages by tomschlick or browse all Laravel packages to compare alternatives.

Last updated

Laravel / Lumen HTTP/2 Server Push Middleware

Build Status StyleCI Latest Stable Version Total Downloads Latest Unstable Version License

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.

Comments