# pronko/magento2-cache-toolbar

> Magento 2 module that adds a quick cache management toolbar to the admin panel

`composer require pronko/magento2-cache-toolbar`

Canonical URL: https://packagento.com/pronko/magento2-cache-toolbar

## At a glance

- **Vendor**: pronko (https://packagento.com/pronko.md)
- **Latest version**: 1.1.6 — released 2026-06-15
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/pronko/magento2-cache-toolbar and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require pronko/magento2-cache-toolbar:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magento 2 module that adds a quick cache management toolbar to the admin panel

## README

Clear cache in one click — from any page, without navigating to System → Cache Management.

[![Latest Version](https://img.shields.io/packagist/v/pronko/magento2-cache-toolbar?style=flat-square)](https://packagist.org/packages/pronko/magento2-cache-toolbar)
[![Total Downloads](https://img.shields.io/packagist/dt/pronko/magento2-cache-toolbar?style=flat-square)](https://packagist.org/packages/pronko/magento2-cache-toolbar)
[![PHP](https://img.shields.io/badge/PHP-8.1%2B-blue?style=flat-square)](https://www.php.net)
[![Magento](https://img.shields.io/badge/Magento-2.4.x-orange?style=flat-square)](https://github.com/magento/magento2)
[![MageOS](https://img.shields.io/badge/MageOS-2.4.6%2B-orange?style=flat-square)](https://mage-os.org)
[![License](https://img.shields.io/badge/License-OSL--3.0-green?style=flat-square)](LICENSE)

---

### The problem

You save a config. Magento says "cache invalidated". You navigate to System → Cache Management. Select cache types. Click Flush. Go back to where you were.

**That's 6 steps for something that should take 1.**

### The solution

A smart status bar appears automatically when your cache is outdated — with a single **Smart Clear** button that clears the right types instantly, without leaving the page.

![Cache Toolbar](docs/img/cache-toolbar-v2.png)

MageOS:

![Cache Toolbar MageOS](docs/img/cache-toolbar-mageos-v2.png)

Clearing cache...

![Clearing cache](docs/img/clearing-cache.png)

Cache cleared...

![Cache cleared](docs/img/cache-cleared.png)

Magento's default "cache invalidated" system message is suppressed — no duplicate warnings.

---

### Features

- **Smart Clear** — clears only the cache types that are actually invalidated, from your configured list
- **Full Clear** — clears all cache types and flushes the cache pool when you need a clean slate
- **Zero-delay detection** — cache status is checked server-side on every page load, bar renders immediately with no AJAX flicker
- **Suppresses Magento's default warning** — no more duplicate "Cache Types are invalidated" messages
- **Keyboard shortcut** — `Ctrl+Shift+C` triggers Smart Clear from anywhere in the admin
- **Auto-dismiss** — success message disappears after 3 seconds, stays out of your way
- **Configurable** — choose which cache types Smart Clear targets via Stores → Configuration
- **ACL-aware** — toolbar only renders for admin users with cache clear permission
- **Accessible** — toolbar message uses `aria-live` and `role="status"` for screen reader support

---

### Installation

```bash
composer require pronko/magento2-cache-toolbar
bin/magento module:enable Pronko_Core Pronko_CacheToolbar
bin/magento setup:upgrade
```

---

### Configuration

**Stores → Configuration → Pronko → Cache Toolbar**

| Setting | Default | Description |
|---|---|---|
| Enable Toolbar | Yes | Show/hide the toolbar |
| Keyboard Shortcut | Yes | Enable `Ctrl+Shift+C` |
| Smart Clear Types | 7 types | Which cache types Smart Clear targets |
| Show Fast Admin Promo | Yes | Promotional banner (disable for client deployments) |

Configuration settings:

![Settings](docs/img/settings.png)

---

### Compatibility

| Platform | Version |
|---|---|
| Magento Open Source | 2.4.4 — 2.4.x |
| Adobe Commerce | 2.4.4 — 2.4.x |
| MageOS | 2.4.6+ |
| PHP | 8.1, 8.2, 8.3, 8.4, 8.5 |

---

### Smart Clear vs Full Clear

| | Smart Clear | Full Clear |
|---|---|---|
| Which types | Invalidated types from your configured list | All registered cache types |
| Cache pool flush | No | Yes |
| CLI equivalent | `cache:clean config full_page` | `cache:flush` |
| Use case | After a config save or deploy | When something is deeply wrong |

---

### Promotional banner

This module ships with an optional promotional banner for [Fast Admin](https://pronkoconsulting.com/fast-admin) — a faster Magento admin interface by Pronko Consulting.

The banner is **fully optional** — disable it at:
Stores → Configuration → Pronko → Cache Toolbar → Show Promo Banner → **No**

![Fast Admin](docs/img/fast-admin-promo.png)

The banner is a static HTML element with a link. No analytics, no tracking, no external requests.

---

### Requirements

- PHP 8.1+
- Magento 2.4.4+ / MageOS 2.4.6+
- `pronko/magento2-core` ^1.0 (installed automatically by Composer)

---

### Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

---

### License

[Open Software License 3.0 (OSL-3.0)](LICENSE)

---

<p align="center">
  Tired of slow Magento admin? &nbsp;
  <a href="https://www.pronkoconsulting.com/fast-admin?utm_source=cache-toolbar&utm_medium=readme&utm_campaign=oss-module">
    <strong>⚡ Fast Admin loads orders in 0.3s →</strong>
  </a>
</p>

## Changelog

### 1.1.6 — 2026-06-15

#### Added

- Unit tests for the toolbar's core classes

#### Changed

- Toolbar messages are now translatable
- Lighter page footprint — trimmed unused data from the toolbar markup

### 1.1.5 — 2026-05-29

#### Changed

- Added MageOS screenshot to README

### 1.1.4 — 2026-05-29

#### Changed

- Updated README title to include MageOS
- Updated README screenshots

### 1.1.3 — 2026-05-29

#### Changed

- `SmartClear` and `FullClear` controllers dispatch `pronko_cache_toolbar_clear_after` event after a successful cache clear, carrying `action`, `cache_types`, `duration_ms`, and `origin=toolbar`

### 1.1.2 — 2026-05-29

#### Fixed

- `SuppressCacheOutdatedNotification` plugin now falls back to Magento's native cache invalidation message for admins who lack the `Pronko_CacheToolbar::cache_clear` ACL permission — previously those admins received no notification at all

### 1.1.1 — 2026-05-29

#### Changed

- ACL: added `translate="title"` to all resource nodes for i18n readiness
- ACL: shortened role-tree leaf titles (`Clear Cache via Cache Toolbar` → `Clear Cache`, `Cache Toolbar Configuration` → `Configuration`) — no permission or id changes

### 1.1.0 — 2026-05-28

#### Added

- ViewModel `Pronko\CacheToolbar\ViewModel\Toolbar` replaces the custom Block class
- Human-readable cache type labels in toolbar message ("Configuration" instead of "config")
- Error handling in SmartClear and FullClear controllers with PSR logger writing to `var/log/pronko.log`
- Request deduplication in JS — rapid clicks no longer fire multiple simultaneous requests
- `aria-live="polite"` and `role="status"` on toolbar message for screen reader support
- `pronko/magento2-core` dependency — shared admin tab, parent ACL resource, and logger

#### Changed

- ACL resources restructured under `Pronko_Core::pronko` parent resource owned by `Pronko_Core`
- Pronko Consulting admin tab definition moved to `Pronko_Core`

#### Removed

- `Block/Adminhtml/Toolbar.php` — replaced by ViewModel (breaking change)

### 1.0.3 — 2026-05-27

#### Added

- i18n/en_US.csv with all translatable strings

#### Changed

- Toolbar message updated from "Cache outdated" to "Cache invalidated" to align with Magento terminology

### 1.0.2 — 2026-05-26

#### Fixed

- PHP version constraint corrected to `>=8.1.0` to match Magento 2.4.4+ support
- Added `magento/module-admin-notification` as an explicit Composer dependency
- Added `Magento_AdminNotification` to module load sequence
- Controllers now implement `HttpPostActionInterface`

### 1.0.1 — 2026-05-25

#### Fixed

- ACL resources restructured under a `Pronko Consulting` parent group

### 1.0.0 — 2026-05-17

#### Added

- Smart Clear button — clears only the invalidated cache types in one click
- Full Clear button — clears all cache types and flushes the cache pool
- Cache status bar appears automatically on page load when cache is outdated
- Keyboard shortcut `Ctrl+Shift+C` to trigger Smart Clear from any admin page
- Configurable Smart Clear cache types via Stores → Configuration → Pronko → Cache Toolbar
- Auto-dismiss success message after 3 seconds
- Fast Admin promo banner — shown after first Smart Clear, dismissible for 30 days

## Recent Versions

| Version | Released |
|---|---|
| 1.1.6 | 2026-06-15 |
| 1.1.5 | 2026-05-29 |
| 1.1.4 | 2026-05-29 |
| 1.1.3 | 2026-05-29 |
| 1.1.2 | 2026-05-28 |
| 1.1.1 | 2026-05-28 |
| 1.1.0 | 2026-05-27 |
| 1.0.3 | 2026-05-25 |
| 1.0.2 | 2026-05-25 |
| 1.0.1 | 2026-05-25 |

Showing 10 of 11 versions. Full release history on https://packagento.com/pronko/magento2-cache-toolbar.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | >=103.0.0 |
| magento/module-admin-notification | >=100.0.0 |
| magento/module-backend | >=102.0.0 |
| magento/module-cache-invalidate | >=100.0.0 |
| php | >=8.1.0 |
| pronko/magento2-core | ^1.0 |

## Quality

Latest release (1.1.6) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 15 | 15 warnings (ruleset: Magento2) — 5 auto-fixable with phpcbf |
| PHPMD | Warning | 1 | 1 rule violation (UnusedFormalParameter:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 5 | valid; 5 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | 1 | 1 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["pronko/magento2-cache-toolbar"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

pronko is a Magento 2 vendor on Packagento. See https://packagento.com/pronko.md for their full catalogue.

