# qoliber/trident-cache-magento2

> Trident Cache integration module for Magento 2

`composer require qoliber/trident-cache-magento2`

Canonical URL: https://packagento.com/qoliber/trident-cache-magento2

## At a glance

- **Vendor**: qoliber (https://packagento.com/qoliber.md)
- **Latest version**: 1.1.0 — released 2026-03-06
- **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/qoliber/trident-cache-magento2 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 qoliber/trident-cache-magento2:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Trident Cache integration module for Magento 2

## Changelog

All notable changes to Qoliber_TridentCache will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [1.1.0] - 2026-03-06

#### Added

- **Cached Pages admin page** — Paginated grid of all cached URLs with host, method, size, TTL, age, hits, and tags. Accessible via System > Trident Cache > Cached Pages.
- **Cache Tags admin page** — Paginated list of all cache tags with entry counts. Accessible via System > Trident Cache > Cache Tags.
- **Tag filtering on entries** — Filter cached entries by tag via the entries page filter form.
- **Tag prefix filtering** — Filter cache tags by name prefix on the tags page.
- **Per-entry purge** — AJAX purge button on each cache entry row for targeted invalidation.
- **Per-tag purge** — AJAX purge button on each tag row to purge all entries with that tag.
- **Clickable tag badges** — Tag badges on entries link to entries filtered by that tag.
- **"View Entries" on tags** — Link from each tag to the entries page filtered by that tag.
- **Top URLs on stats page** — Top 10 URLs by request count table on the Cache Statistics page.
- **Sorting** — Sort entries by age, size, hits, or TTL. Sort tags by count or name.
- **TridentClient API methods** — Added `getEntries()`, `getTags()`, `getTopUrls()`, `purgeUrl()`.
- **Configurable TTL, grace period, and static asset TTL** via admin system configuration.
- **ESI (Edge Side Includes) support** — Enable ESI processing with configurable max nesting depth. Adds `Surrogate-Control` header when enabled.
- **ConfigTypePlugin** — Maps Trident cache type (3) to Varnish (2) so core Magento FPC plugins activate without patching core code.
- **Health indicator on Cache Management page** — Green/orange status dot with Trident version and uptime display.
- **Unit and integration test suite** — PHPUnit 10.5 tests for TridentClient, Config, all plugins, observers, and PurgeStrategy.
- **Vary dimension badges** — Cache entries with the same URL but different vary values (e.g. customer groups) now show distinguishing badges.

#### Changed

- **ResponsePlugin rewritten** — Now uses admin-configured TTL for `s-maxage` and grace period for `stale-while-revalidate` instead of copying `max-age`.
- **Config.php** — Removed `PageCacheConfig` dependency, reads caching application type directly from `ScopeConfig`.

### [1.0.1] - 2026-02-15

#### Fixed

- **`purgePattern()` wrong API endpoint** — `TridentClient::purgePattern()` was calling `/admin/purge/pattern` which does not exist. Fixed to use the correct endpoint `/admin/purge/urls`.
- **Cache tags reference table** — The admin purge page showed incorrect tag patterns (`product-{id}`, `category-{id}`) instead of Magento's actual cache tags (`cat_p_{id}`, `cat_c_{id}`, `cms_p_{id}`, `cms_b_{id}`).
- **PurgeAll controller redirect** — Changed from hardcoded redirect path to `setRefererOrBaseUrl()` so users return to the page they came from.
- **Null safety in CacheBlockPlugin** — Added null check on `getButtonList()` to prevent errors when button list is not available.

#### Added

_(Changelog truncated for .md surface. Full history on https://packagento.com/qoliber/trident-cache-magento2.)_

## Recent Versions

| Version | Released |
|---|---|
| 1.1.0 | 2026-03-06 |
| 1.0.1 | 2026-02-15 |
| 1.0.0 | 2026-02-13 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-catalog | * |
| magento/module-cms | * |
| magento/module-customer | * |
| magento/module-page-cache | * |
| magento/module-store | * |
| php | >=8.1 |

## 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=["qoliber/trident-cache-magento2"],
  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

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

