PHPackages                             melbahja/http2-pusher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. melbahja/http2-pusher

ActiveLibrary[HTTP &amp; Networking](/categories/http)

melbahja/http2-pusher
=====================

PHP Http2 Server Pusher

v1.1.0(5y ago)2829.9k↓50%71MITPHPPHP &gt;=7.1CI failing

Since Oct 21Pushed 5y ago5 watchersCompare

[ Source](https://github.com/melbahja/Http2Pusher)[ Packagist](https://packagist.org/packages/melbahja/http2-pusher)[ RSS](/packages/melbahja-http2-pusher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

Http2Pusher
===========

[](#http2pusher)

PHP Http2 Server Pusher

About Http2 Server Push :
-------------------------

[](#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](https://en.wikipedia.org/wiki/HTTP/2_Server_Push)

[![http2](https://camo.githubusercontent.com/b69ea1f4e5f693f5087e55bfb28b7341f19cc40f312587f644a6a02cdf698d31/68747470733a2f2f626c6f672e636c6f7564666c6172652e636f6d2f636f6e74656e742f696d616765732f323031352f31322f687474702d322d6d756c7469706c6578696e672e706e67)](https://camo.githubusercontent.com/b69ea1f4e5f693f5087e55bfb28b7341f19cc40f312587f644a6a02cdf698d31/68747470733a2f2f626c6f672e636c6f7564666c6172652e636f6d2f636f6e74656e742f696d616765732f323031352f31322f687474702d322d6d756c7469706c6578696e672e706e67)image by cloudflare

Installation :
--------------

[](#installation-)

using composer: `composer require melbahja/http2-pusher`

Usage :
-------

[](#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 :
----------------

[](#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 :
---------

[](#license-)

[MIT](https://github.com/melbahja/Http2Pusher/blob/master/LICENSE) Copyright (c) 2017 Mohamed Elbahja

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~561 days

Total

3

Last Release

2000d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67b45037a03b3a6ed6cc118eb636a3cc544366594e8dc460f9f87fe30dc6bd6b?d=identicon)[melbahja](/maintainers/melbahja)

---

Top Contributors

[![melbahja](https://avatars.githubusercontent.com/u/8259014?v=4)](https://github.com/melbahja "melbahja (4 commits)")[![obud](https://avatars.githubusercontent.com/u/40399469?v=4)](https://github.com/obud "obud (2 commits)")

---

Tags

httphttp2http2-pushphpphp-libraryphp7httphttp2pusherPHP7php71

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/melbahja-http2-pusher/health.svg)

```
[![Health](https://phpackages.com/badges/melbahja-http2-pusher/health.svg)](https://phpackages.com/packages/melbahja-http2-pusher)
```

###  Alternatives

[symfony/web-link

Manages links between resources

1.4k99.0M250](/packages/symfony-web-link)[pusher/pusher-http-laravel

\[DEPRECATED\] A Pusher bridge for Laravel

400509.0k3](/packages/pusher-pusher-http-laravel)[openswoole/core

Openswoole core library

181.1M32](/packages/openswoole-core)[swoole/etcd-client

Grpc PHP Client base on Swoole Http2 Coroutine

1973.2k1](/packages/swoole-etcd-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
