All Projects → JacobBennett → Laravel Http2serverpush

JacobBennett / Laravel Http2serverpush

Licence: mit
A HTTP2 SeverPush Middleware for Laravel 5

Projects that are alternatives of or similar to Laravel Http2serverpush

Laravel Http2 Server Push
A middleware package for Laravel to enable server push for your script, style, and image assets.
Stars: ✭ 174 (-40.82%)
Mutual labels:  middleware, laravel, http2
Laravel Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Stars: ✭ 136 (-53.74%)
Mutual labels:  middleware, laravel
L5 Very Basic Auth
Stateless HTTP basic auth for Laravel without the need for a database.
Stars: ✭ 127 (-56.8%)
Mutual labels:  middleware, laravel
Laravel Rate Limited Job Middleware
A job middleware to rate limit jobs
Stars: ✭ 166 (-43.54%)
Mutual labels:  middleware, laravel
Laravel Localize Middleware
Configurable localization middleware for your Laravel >=5.1 application
Stars: ✭ 92 (-68.71%)
Mutual labels:  middleware, laravel
Twig
Twig - less is more's web server for golang
Stars: ✭ 98 (-66.67%)
Mutual labels:  middleware, http2
Request Migrations
HTTP Request Migrations for API Versioning like Stripe
Stars: ✭ 149 (-49.32%)
Mutual labels:  middleware, laravel
Laravel Remember Uploads
Laravel Middleware and helper for remembering file uploads during validation redirects
Stars: ✭ 67 (-77.21%)
Mutual labels:  middleware, laravel
Laravel Authorize
A middleware to check authorization
Stars: ✭ 179 (-39.12%)
Mutual labels:  middleware, laravel
Vue Gates
🔒 A Vue.js & Nuxt.js plugin that allows you to use roles and permissions in your components or DOM elements, also compatible as middleware and methods.
Stars: ✭ 184 (-37.41%)
Mutual labels:  middleware, laravel
Laravel Shield
A HTTP basic auth middleware for Laravel
Stars: ✭ 193 (-34.35%)
Mutual labels:  middleware, laravel
Depictr
A middleware for rendering static pages when crawled by search engines
Stars: ✭ 92 (-68.71%)
Mutual labels:  middleware, laravel
Laravel Analytics
Analytics for the Laravel framework.
Stars: ✭ 91 (-69.05%)
Mutual labels:  middleware, laravel
Faygo
Faygo is a fast and concise Go Web framework that can be used to develop high-performance web app(especially API) with fewer codes. Just define a struct handler, faygo will automatically bind/verify the request parameters and generate the online API doc.
Stars: ✭ 1,557 (+429.59%)
Mutual labels:  middleware, http2
Go Web
A new Golang MVC Framework. Like Laravel... but faster!
Stars: ✭ 79 (-73.13%)
Mutual labels:  middleware, laravel
Has Parameters
A trait that allows you to pass arguments to Laravel middleware in a more PHP'ish way.
Stars: ✭ 149 (-49.32%)
Mutual labels:  middleware, laravel
Blazar
Pre-Render Pages on the Fly in Laravel
Stars: ✭ 14 (-95.24%)
Mutual labels:  middleware, laravel
Htmlcache
Laravel middleware to cache the rendered html
Stars: ✭ 35 (-88.1%)
Mutual labels:  middleware, laravel
Laravel Demo Mode
A package to protect your work in progress from prying eyes
Stars: ✭ 259 (-11.9%)
Mutual labels:  middleware, laravel
Laravel Multisite
Multiple sites on one codebase
Stars: ✭ 214 (-27.21%)
Mutual labels:  middleware, laravel

Server Push Middleware for Laravel 5

Latest Version on Packagist Travis Software License Total Downloads

Server Push is a HTTP/2 concept which allows the server to speculatively start sending resources to the client. This can potentially speed up initial page load times: the browser doesn't have to parse the HTML page and find out which other resources to load, instead the server can start sending them immediately. (source)

This package aims to provide the easiest experience for adding Server Push to your responses. Simply route your requests through the AddHttp2ServerPush middleware and it will automatically create and attach the Link headers necessary to implement Server Push for your CSS, JS and Image assets.

Requirements

  • Laravel 5
  • PHP 7

Installation

You can install the package via composer:

$ composer require jacobbennett/laravel-http2serverpush

Next you must add the \JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush-middleware to the kernel. Adding it to the web group is recommeneded as API's do not have assets to push.

// app/Http/Kernel.php

...
protected $middlewareGroups = [
    'web' => [
        ...
        \JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush::class,
        ...
    ],
    ...
];

Publish config

php artisan vendor:publish --provider="JacobBennett\Http2ServerPush\ServiceProvider"

Usage

When you route a request through the AddHttp2ServerPush middleware, the response is scanned for any link, script or img tags that could benefit from being loaded using Server Push. These assets will be added to the Link header before sending the response to the client. Easy!

Note: To push an image asset, it must have one of the following extensions: bmp, gif, jpg, jpeg, png, tiff or svg.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

Thanks to the https://github.com/spatie/laravel-pjax package for providing a great starting point for testing Middlewares.

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].