PHPackages                             studio24/http-cache-clear - 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. [Caching](/categories/caching)
4. /
5. studio24/http-cache-clear

ActiveLibrary[Caching](/categories/caching)

studio24/http-cache-clear
=========================

Clear old cache data from the Symfony HTTP Cache (filesystem) based on an expiry time

v0.2.1(6y ago)116.0k↓33.3%MITPHPPHP ^7.2

Since Oct 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/studio24/http-cache-clear)[ Packagist](https://packagist.org/packages/studio24/http-cache-clear)[ Docs](https://github.com/studio24/http-cache-clear)[ RSS](/packages/studio24-http-cache-clear/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

Clear the expired items from HTTP Cache on the command line
===========================================================

[](#clear-the-expired-items-from-http-cache-on-the-command-line)

Symfony's [HTTP Cache](https://symfony.com/doc/current/http_cache.html) is a powerful way to cache entire HTTP responses and provide fast, full-page caching for your website or web application.

However, due to a [known flaw](https://github.com/symfony/symfony/pull/6855) if you use the default filesystem method to store HTTP Cache files this does not clean up expired cache files, which can fill up a disk drive.

We created this small tool to help delete the expired cache files from Symfony's HTTP Cache.

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

[](#installation)

Install via [Composer](https://getcomposer.org/):

```
composer require studio24/http-cache-clear

```

Usage
-----

[](#usage)

The default command clears the HTTP Cache of cache files that are 4 hours or older.

```
./bin/http-cache-clear

```

By default the command clears the cache in `var/cache` for the `prod` environment and for all files older than `4` hours. You can change these options on the command line. View help to see how:

```
./bin/http-cache-clear -h

```

One note on the `--path` option. The command appends the environment and `http_cache` folder, so the following command actually clears the HTTP cache in `cache/prod/http_cache`.

```
./bin/http-cache-clear --path=cache

```

The default is to clear all files older than 4 hours. You can change this by passing the `expiry` argument.

```
./bin/http-cache-clear var/cache --expiry=24

```

Tests
-----

[](#tests)

Run phpunit:

```
./vendor/bin/phpunit

```

Run codesniffer:

```
./vendor/bin/phpcs

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Credits
-------

[](#credits)

- [Maria Beznea](https://www.studio24.net/)
- [Simon R Jones](https://github.com/simonrjones)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.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 ~42 days

Total

3

Last Release

2317d ago

PHP version history (2 changes)v0.1.0PHP ^7.1

0.2.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb0acae91f4ac95e074c4d3f2c70bfc166afc22c68810c7e1154d21fb4c27701?d=identicon)[simonrjones](/maintainers/simonrjones)

![](https://www.gravatar.com/avatar/70464d5c596a2aa2b4bf2f5253ae463499ad769e3ab4293ffa3f123a24da56d4?d=identicon)[AlanJIsaacson](/maintainers/AlanJIsaacson)

![](https://www.gravatar.com/avatar/f6cf7b34cf460ecdfc28a5ccd0ed3a0b226aed607e9f04011a78794392a4a7db?d=identicon)[gtrinkwon](/maintainers/gtrinkwon)

---

Top Contributors

[![simonrjones](https://avatars.githubusercontent.com/u/601316?v=4)](https://github.com/simonrjones "simonrjones (11 commits)")[![mbeznea](https://avatars.githubusercontent.com/u/41904428?v=4)](https://github.com/mbeznea "mbeznea (1 commits)")

---

Tags

symfonycachehttpcache

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/studio24-http-cache-clear/health.svg)

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

###  Alternatives

[barryvdh/laravel-httpcache

HttpCache for Laravel

513400.6k7](/packages/barryvdh-laravel-httpcache)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)

PHPackages © 2026

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