PHPackages                             webfixit/cachehostsmanager - 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. [CLI &amp; Console](/categories/cli)
4. /
5. webfixit/cachehostsmanager

ActiveMagento2-module[CLI &amp; Console](/categories/cli)

webfixit/cachehostsmanager
==========================

Allows the purge/clear/flush of the PHP OpCache via the CLI and Magento2 Backend

1.0.1(7y ago)87022OSL-3.0PHP

Since May 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/wiardvanrij/m2-cache-hosts-manager)[ Packagist](https://packagist.org/packages/webfixit/cachehostsmanager)[ RSS](/packages/webfixit-cachehostsmanager/feed)WikiDiscussions master Synced 4d ago

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

Magento2 cache hosts Manager
============================

[](#magento2-cache-hosts-manager)

Allows to manage your cache hosts via the CLI. You can add for instance Varnish servers and remove them again in the configuration.

Status
------

[](#status)

I believe this package is stable. Yet I want to warn you about using it in production:

- It has not been used intensively by the community
- Magento core changes often - I cannot guarenty this package will work on the next update.
- Make sure you have the correct backups of your configurations.

When you are in need of a tool like this, I assume you have somewhat decent knowledge the make the right calls ;)

Why
---

[](#why)

Because the default CLI setting `(config:set --http-cache-hosts)` is not usefull. The config:set commands overrides *all* your hosts. Imagine a dynamic setup where you add a new server. The configuration (env.php) is shared via a NFS (or whatever volume). You must know *all* hosts if you want to add your new host.

With this manager you can simply do `bin/magento cachehosts:add {currenthost}` and it will append the server, rather than overriding all your servers

About me
--------

[](#about-me)

I'm a DevOps engineer for a full service digital agency in the Netherlands. When possible I try to create opensource scripts / extentions and tools. If you appriciate my work, please be so kind to donate so I can keep drinking beer.

[![paypal](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UDG2ZGDZ9TMEE)

How the CLI works
-----------------

[](#how-the-cli-works)

There are 2 commands:

` bin/magento cachehosts:add`

` bin/magento cachehosts:remove`

Arguments are the host(s), comma seperated

### CLI Usage

[](#cli-usage)

Add

```
// Using default port
bin/magento cachehosts:add 127.0.0.1
// Adding multiple hosts
bin/magento cachehosts:add 127.0.0.1,127.0.0.2
// Adding with port
bin/magento cachehosts:add 127.0.0.1:1337
```

Remove

```
// Using default port
bin/magento cachehosts:remove 127.0.0.1
// Removing multiple hosts
bin/magento cachehosts:remove 127.0.0.1,127.0.0.2
// Removing with port
bin/magento cachehosts:remove 127.0.0.1:1337
```

Mixing up

```
bin/magento cachehosts:remove 127.0.0.1:1337,127.0.0.1
```

It is ok to have the same host on different ports.

Install with Composer
---------------------

[](#install-with-composer)

```
composer require webfixit/cachehostsmanager
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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 ~39 days

Total

2

Last Release

2886d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75a4dd4094cca0b6b256d9ef693893fe973687932619eb235a4c354c680b47de?d=identicon)[wiardvanrij](/maintainers/wiardvanrij)

---

Top Contributors

[![wiardvanrij](https://avatars.githubusercontent.com/u/5786097?v=4)](https://github.com/wiardvanrij "wiardvanrij (1 commits)")

---

Tags

climagentomagento-2magento-2-extensionmagento-modulemagento2magento2-extensionmagento2-modulemanagerphpphp7pluginvarnishvarnish-cache

### Embed Badge

![Health badge](/badges/webfixit-cachehostsmanager/health.svg)

```
[![Health](https://phpackages.com/badges/webfixit-cachehostsmanager/health.svg)](https://phpackages.com/packages/webfixit-cachehostsmanager)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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