PHPackages                             jsor/http-client-hints - 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. jsor/http-client-hints

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

jsor/http-client-hints
======================

Utilities for working with HTTP Client Hints.

v1.0.0(7y ago)125MITPHPPHP ^5.6 || ^7.0

Since Feb 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jsor/http-client-hints)[ Packagist](https://packagist.org/packages/jsor/http-client-hints)[ RSS](/packages/jsor-http-client-hints/feed)WikiDiscussions master Synced 3w ago

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

HTTP Client Hints
=================

[](#http-client-hints)

[![Build Status](https://camo.githubusercontent.com/b551a156a08a2c3744473d4749c3f8ae61cc54040301788a53d8344b716fc29f/68747470733a2f2f7472617669732d63692e6f72672f6a736f722f687474702d636c69656e742d68696e74732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jsor/http-client-hints?branch=master)[![Coverage Status](https://camo.githubusercontent.com/34f69665bba0ae3e448d370197d47c545e9a9fc180f2b45bd298f75bf698649d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6a736f722f687474702d636c69656e742d68696e74732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/jsor/http-client-hints?branch=master)

Utilities for working with [HTTP Client Hints](https://httpwg.org/http-extensions/client-hints.html).

Installation
------------

[](#installation)

Install the latest version with [Composer](https://getcomposer.org).

```
composer require jsor/http-client-hints
```

Check the [Packagist page](https://packagist.org/packages/jsor/http-client-hints)for all available versions.

Example
-------

[](#example)

```
$resolved = (new Jsor\HttpClientHints\Resolver())
    ->withAllowedHeaders([
        // Process only Width and DPR headers
        'Width',
        'DPR',
    ])
    ->withMapping([
        // Map Width header to w key
        'width'  => 'w',
        // Needed to extract the height from the query params
        // for recalculation depending on Width if present
        'height' => 'h',
    ])
    ->resolve($_SERVER, $_GET)
;

if (isset($resolved['dpr'])) {
    header('Content-DPR: ' . $resolved['dpr']);
    header('Vary: DPR', false);
}

if (isset($resolved['w'])) {
    header('Vary: Width', false);
}

// Use $resolved to generate thumbnails.
// If you use Glide (https://github.com/thephpleague/glide), this could look
// something like:

$server = League\Glide\ServerFactory::create([
    'source' => 'path/to/source/folder',
    'cache' => 'path/to/cache/folder',
]);
$server->outputImage($path, array_merge($_GET, $resolved));
```

License
-------

[](#license)

Copyright (c) 2016-2018 Jan Sorgalla. Released under the [MIT License](LICENSE).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~468 days

Total

3

Last Release

2855d ago

Major Versions

v0.1.1 → v1.0.02018-09-05

PHP version history (2 changes)v0.1.0PHP &gt;=5.3.0

v1.0.0PHP ^5.6 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5de14776bbddf901c6e24d35829fe66fe997c303d53aca83cc7d1a90bb0b7110?d=identicon)[jsor](/maintainers/jsor)

---

Top Contributors

[![jsor](https://avatars.githubusercontent.com/u/55574?v=4)](https://github.com/jsor "jsor (19 commits)")

---

Tags

httpclientimageresponsiveresolverhints

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jsor-http-client-hints/health.svg)

```
[![Health](https://phpackages.com/badges/jsor-http-client-hints/health.svg)](https://phpackages.com/packages/jsor-http-client-hints)
```

###  Alternatives

[php-http/httplug

HTTPlug, the HTTP client abstraction for PHP

2.6k319.6M739](/packages/php-http-httplug)[swoole/etcd-client

Grpc PHP Client base on Swoole Http2 Coroutine

1973.3k1](/packages/swoole-etcd-client)[chillerlan/php-httpinterface

A PSR-7/17/18 http message/client implementation

1417.8k6](/packages/chillerlan-php-httpinterface)

PHPackages © 2026

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