PHPackages                             wazum/cache-guard - 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. wazum/cache-guard

ActiveTypo3-cms-extension[CLI &amp; Console](/categories/cli)

wazum/cache-guard
=================

Prevents backend cache flushes of protected cache groups in production-like contexts

1.0.1(1mo ago)3221↑133.3%GPL-2.0-or-laterPHPPHP ^8.2CI passing

Since Jun 23Pushed 1mo agoCompare

[ Source](https://github.com/wazum/cache-guard)[ Packagist](https://packagist.org/packages/wazum/cache-guard)[ RSS](/packages/wazum-cache-guard/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Cache Guard
===========

[](#cache-guard)

[![Tests](https://github.com/wazum/cache-guard/actions/workflows/ci.yml/badge.svg)](https://github.com/wazum/cache-guard/actions)[![PHP](https://camo.githubusercontent.com/a8b5158830418a4f03a426749c19915d4904d8d367e2677d991d9f67eb639ea2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e32253230253743253230382e33253230253743253230382e34253230253743253230382e352d626c75652e737667)](https://www.php.net/)[![TYPO3](https://camo.githubusercontent.com/6668fbdb17be72e36ec7c175af8ff21200527f0a70b4131e9cc09305720de688/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5459504f332d31322e3425323025374325323031332e3425323025374325323031342e332d6f72616e67652e737667)](https://typo3.org/)[![License](https://camo.githubusercontent.com/77e900ae34f8da9ccccc42662fce61a94ab07ddbfe3f7d066178e824f3673dbd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323076322d626c75652e737667)](LICENSE)

Deliberate cache control for TYPO3: **protect** the warmed system caches from destructive backend flushes between deployments, and **flush precisely** the caches you mean to. Editors keep clearing page caches, deployments keep flushing everything, and you can clear a single cache (e.g. `fluid_template`) instead of wiping the whole system group — while the bulk flush of warmed system caches stays locked in production.

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

[](#installation)

```
composer require wazum/cache-guard
```

No setup needed — the defaults lock the `system` cache group in `Production` contexts.

Locking system-cache flushes
----------------------------

[](#locking-system-cache-flushes)

Between deployments the warmed system caches (compiled PHP code, Fluid templates, l10n, …) should not be wiped by a stray backend click. Cache Guard prevents that in production-like contexts, while everyday page-cache clearing keeps working.

### What it blocks

[](#what-it-blocks)

- Flushing of configured cache groups (default: `system`) in configured application contexts (default: `Production`, matched as prefix, so `Production/Staging` is included).
- The full opcache reset triggered by "Flush all caches"; targeted single-file opcache invalidation keeps working.
- It replaces the "Flush all caches" entry in the clear-cache toolbar with a disabled notice while the lock is active; the dropdown and "Flush frontend caches" stay in place.

Note

Intercepting the opcache reset requires TYPO3 13.4+ — on 12.4 the cache-group lock applies, but the opcache reset is not intercepted.

[![Clear-cache dropdown with the system cache flush locked](Documentation/Images/clear-cache-dropdown.png)](Documentation/Images/clear-cache-dropdown.png)

### What it leaves alone

[](#what-it-leaves-alone)

- "Flush frontend caches" (pages) keeps working for editors.
- CLI: `vendor/bin/typo3 cache:flush` always works — deployments are unaffected.
- The Install Tool / Maintenance "Flush cache" and the DI container cache (system-maintainer territory).
- Tag-based invalidation (`flushCachesByTag`/`flushCachesByTags`) — targeted invalidation is not a bulk clear.

### Configuration

[](#configuration)

Admin Tools → Settings → Extension Configuration → cache\_guard:

OptionDefaultDescription`lockedGroups``system`Comma-separated cache groups that must not be flushed from the backend`lockedContexts``Production`Comma-separated application context prefixes in which the lock is active### Defense in depth (optional)

[](#defense-in-depth-optional)

Hide the "Flush all caches" entry per user/group via User TSconfig (UI only, the lock above is the actual enforcement):

```
options.clearCache.all = 0

```

Flushing individual caches (CLI)
--------------------------------

[](#flushing-individual-caches-cli)

Clear only specific caches without wiping a whole group — e.g. recompile Fluid templates after a deployment without touching the warmed PHP-code, l10n or DI caches:

```
vendor/bin/typo3 cache:flush --cache fluid_template
vendor/bin/typo3 cache:flush --cache fluid_template,l10n
```

All identifiers must be valid or nothing is flushed. The dependency injection cache is not flushable this way — use `cache:flush --group di`.

Run the option without a value (or with an unknown name) at a terminal to pick interactively:

```
vendor/bin/typo3 cache:flush --cache
```

[![Interactive cache picker](Documentation/Images/cache-flush-picker.gif)](Documentation/Images/cache-flush-picker.gif)

In CI and deployment, pass `--no-interaction` (`-n`) so a missing or unknown identifier fails with a clear error instead of opening the picker:

```
vendor/bin/typo3 cache:flush --cache fluid_template --no-interaction
```

Requirements
------------

[](#requirements)

- TYPO3 12.4, 13.4 or 14.3
- PHP 8.2, 8.3, 8.4 or 8.5 (TYPO3 12.4 runs on 8.2–8.3)

License
-------

[](#license)

GPL-2.0-or-later — see [LICENSE](LICENSE).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Every ~0 days

Total

2

Last Release

46d ago

### Community

Maintainers

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

---

Top Contributors

[![wazum](https://avatars.githubusercontent.com/u/146727?v=4)](https://github.com/wazum "wazum (29 commits)")

---

Tags

backendcachecache-controlcache-managementclideploymentphptypo3typo3-cmstypo3-extension

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wazum-cache-guard/health.svg)

```
[![Health](https://phpackages.com/badges/wazum-cache-guard/health.svg)](https://phpackages.com/packages/wazum-cache-guard)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103574.3k64](/packages/friendsoftypo3-content-blocks)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

40543.5k](/packages/wazum-sluggi)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

631.1M8](/packages/netresearch-rte-ckeditor-image)[typo3/cms-redirects

TYPO3 CMS Redirects - Create manual redirects, list existing redirects and automatically createredirects on slug changes.

167.6M84](/packages/typo3-cms-redirects)[typo3/cms-adminpanel

TYPO3 CMS Admin Panel - The Admin Panel displays information about your site in the frontend and contains a range of metrics including debug and caching information.

115.8M69](/packages/typo3-cms-adminpanel)[hn/typo3-mcp-server

TYPO3 extension that provides a Model Context Protocol (MCP) server for interacting with TYPO3 pages and records

9231.4k2](/packages/hn-typo3-mcp-server)

PHPackages © 2026

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