PHPackages                             vojtechrichter/http-cache-header-builder - 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. vojtechrichter/http-cache-header-builder

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

vojtechrichter/http-cache-header-builder
========================================

v0.0.1(5mo ago)00MITPHPPHP &gt;=8.5

Since Feb 17Pushed 2mo agoCompare

[ Source](https://github.com/vojtechrichter/http-cache-header-builder)[ Packagist](https://packagist.org/packages/vojtechrichter/http-cache-header-builder)[ RSS](/packages/vojtechrichter-http-cache-header-builder/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

HTTP Cache Header Builder
=========================

[](#http-cache-header-builder)

Builder for HTTP cache headers like: Cache-Control, Surrogate-Control, Vary, ETag

Value combinations are being validated so you avoid meaningless cache directives.

PSR-15 example usage:

```
$middleware = new CacheHeaderMiddleware([
	'/assets/**' => new CacheProfile(
		cacheControl: CacheControlHeader::immutableAsset(),
		vary: VaryBuilder::create()->acceptEncoding()->build(),
	),
	'/api/**' => new CacheProfile(
		cacheControl: CacheControlBuilder::create()
			->public()
			->maxAge(60)
			->sMaxAge(300)
			->mustRevalidate()
			->build(),
		vary: VaryBuilder::create()->acceptEncoding()->accept()->authorization()->build(),
			surrogate: SurrogateControl::maxAge(300)->withStaleWhileRevalidate(60),
		),
	'/**' => new CacheProfile(
		cacheControl: CacheControlHeader::revalidate(),
	),
]);
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance79

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

154d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/74950132?v=4)[Vojtěch Richter](/maintainers/VojtechRichter)[@vojtechrichter](https://github.com/vojtechrichter)

---

Top Contributors

[![vojtechrichter](https://avatars.githubusercontent.com/u/74950132?v=4)](https://github.com/vojtechrichter "vojtechrichter (9 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vojtechrichter-http-cache-header-builder/health.svg)

```
[![Health](https://phpackages.com/badges/vojtechrichter-http-cache-header-builder/health.svg)](https://phpackages.com/packages/vojtechrichter-http-cache-header-builder)
```

###  Alternatives

[league/openapi-psr7-validator

Validate PSR-7 messages against OpenAPI (3.0.2) specifications expressed in YAML or JSON

56217.4M99](/packages/league-openapi-psr7-validator)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M126](/packages/mezzio-mezzio)[hyperf/hyperf

A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.

6.9k3.3k2](/packages/hyperf-hyperf)[sunrise/http-router

A powerful solution as the foundation of your project.

17451.8k11](/packages/sunrise-http-router)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

587.2M102](/packages/laminas-laminas-stratigility)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28591.3k3](/packages/mezzio-mezzio-authentication-oauth2)

PHPackages © 2026

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