All Projects → melbahja → Http2Pusher

melbahja / Http2Pusher

Licence: MIT license
PHP Http2 Server Push

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Http2Pusher

django-http2-middleware
⚡️Django middleware to automatically send preload headers before views runs, enabling faster HTTP2 server-push (with CSP support).
Stars: ✭ 65 (+140.74%)
Mutual labels:  http2, http2-push
Roadrunner
🤯 High-performance PHP application server, load-balancer and process manager written in Golang
Stars: ✭ 6,122 (+22574.07%)
Mutual labels:  http2, http2-push
Vulcain
Fast and idiomatic client-driven REST APIs.
Stars: ✭ 3,190 (+11714.81%)
Mutual labels:  http2, http2-push
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 (+5666.67%)
Mutual labels:  http2, http2-push
Jetty.project
Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
Stars: ✭ 3,260 (+11974.07%)
Mutual labels:  http2, http2-push
pusher
golang : HTTP2 Push Handler collection
Stars: ✭ 15 (-44.44%)
Mutual labels:  http2, http2-push
awacs
Next-gen mobile first analytics server (think Mixpanel, Google Analytics) with built-in encryption supporting HTTP2 and gRPC. Node.js, headless, API-only, horizontally scaleable.
Stars: ✭ 52 (+92.59%)
Mutual labels:  http2
hunt-http
http library for D, support http 1.1 / http 2.0 (http2) / websocket server and client.
Stars: ✭ 29 (+7.41%)
Mutual labels:  http2
next.js-boilerplate
next.js bolierplate, next.js 的开发模板
Stars: ✭ 28 (+3.7%)
Mutual labels:  http2
th2c
Tornado HTTP/2 Client
Stars: ✭ 79 (+192.59%)
Mutual labels:  http2
http-protocol
HTTP协议原理分享
Stars: ✭ 123 (+355.56%)
Mutual labels:  http2
async-websocket
Asynchronous WebSocket client and server, supporting HTTP/1 and HTTP/2 for Ruby.
Stars: ✭ 111 (+311.11%)
Mutual labels:  http2
apns2
Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens
Stars: ✭ 66 (+144.44%)
Mutual labels:  http2
cashpack
A stateless event-driven HPACK codec
Stars: ✭ 25 (-7.41%)
Mutual labels:  http2
docker-imgproxy
🌐 An ultra fast, production-grade on-the-fly image processing web server. Designed for high throughput with Nginx caching. Powered by imgproxy.
Stars: ✭ 45 (+66.67%)
Mutual labels:  http2
3dub
www dev server with livereload, file watching, http2, https, self signed cert generation
Stars: ✭ 28 (+3.7%)
Mutual labels:  http2
hyper2web
Super Fast Backend Framework (Educational Purpose)
Stars: ✭ 28 (+3.7%)
Mutual labels:  http2
machine gun
HTTP/1 and HTTP/2 client for Elixir. Based on Gun and Poolboy.
Stars: ✭ 62 (+129.63%)
Mutual labels:  http2
pyh2o
Python binding for the H2O HTTP server
Stars: ✭ 25 (-7.41%)
Mutual labels:  http2
http2-client
Transparently make http request to both http1 / http2 server.
Stars: ✭ 31 (+14.81%)
Mutual labels:  http2

Http2Pusher

PHP Http2 Server Pusher

About Http2 Server Push :

HTTP/2 Push allows a web server to send resources to a web browser before the browser gets to request them. It is, for the most part, a performance technique that can help some websites load faster. - wikipedia

http2 image by cloudflare

Installation :

using composer: composer require melbahja/http2-pusher

Usage :

get the instance:

require 'vendore/autoload.php';

use Melbahja\Http2\Pusher;

$pusher = Pusher::getInstance();

examples:

// set css file
$pusher->link('/assets/css/style.css');

// set css and image and src
$pusher->link('/asstes/css/main.css')
	->src('/assets/js/scripts.js')
	->img('/assets/img/logo.png')
	-set(Pusher::IMG, '/assets/img/logo2.png');


// set link with options
$pusher->link('https://fonts.gstatic.com', [
	'as' => false,
	'rel' => 'preconnect' 
]);	

// rel by default is preload
// as by default is the link type 


// push header
$pusher->push();

Public methods :

Pusher::getInstance(): PusherInterface

Pusher::link(string $link, array $opts = []): PusherInterface

Pusher::src(string $link, array $opts = []): PusherInterface

Pusher::img(string $link, array $opts = []): PusherInterface

Pusher::set(string $type, string $link, array $opts = []): PusherInterface

Pusher::getHeader(string $type = null): string

Pusher::push(string $type = null): void

Pusher::public function toHeader(string $type, array $urls): null|string

License :

MIT Copyright (c) 2017 Mohamed Elbahja

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].