PHPackages                             staabm/http-cache-control - 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. staabm/http-cache-control

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

staabm/http-cache-control
=========================

A tiny lib which provides documented constants and example use-cases for the HTTP Cache-Control header.

1.0(4y ago)34MITPHPPHP ^7.2 || ^8.0

Since Apr 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/staabm/http-cache-control)[ Packagist](https://packagist.org/packages/staabm/http-cache-control)[ RSS](/packages/staabm-http-cache-control/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Http-Cache-Control
------------------

[](#http-cache-control)

A tiny lib which provides documented [constants](https://github.com/staabm/http-cache-control/blob/main/lib/Constants.php) and [example use-cases](https://github.com/staabm/http-cache-control/blob/main/lib/UseCase.php) for the HTTP `Cache-Control` header, based on the [official cloudflare documentation](https://developers.cloudflare.com/cache/about/cache-control/).

Sending proper Cache-Control headers is essential to each web-application, but the required keywords are sometimes misleading and ambiguous. This library aims to provide a more reliable and consistent way to set the Cache-Control header.

Example
-------

[](#example)

```
use staabm\HttpCacheControl\Constants;
use staabm\HttpCacheControl\UseCase;

class MyController {
    public function sendPdf(string $pdfFile) {
        header(Constants::CACHE_CONTROL .':'. UseCase::cacheOnBrowserAndProxyRequireProxyRevalidation());

        readfile($pdfFile);
    }

    public function sendGdpr(string $pdfFile) {
        header(Constants::CACHE_CONTROL_CLOUDFLARE .':'. UseCase::cacheOnBrowserAndProxyForDifferentTime(300, 3600));

        readfile($pdfFile);
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

1489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99d4e5e5fa8fb7d0782de39b43c558953d0a5881a7ba596b90ed9c312db8c4d9?d=identicon)[staabm](/maintainers/staabm)

---

Top Contributors

[![clxmstaab](https://avatars.githubusercontent.com/u/47448731?v=4)](https://github.com/clxmstaab "clxmstaab (2 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (2 commits)")

### Embed Badge

![Health badge](/badges/staabm-http-cache-control/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M317](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M292](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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