qoliber / trident-cache-magento2
qoliber/trident-cache-magento2
Trident Cache integration module for Magento 2
No README yet
The vendor hasn't published a README for this package. The latest version's install command is on the right.
Changelog
All notable changes to Qoliber_TridentCache will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
From v1.4.0 the module version tracks the Trident engine version it integrates
with (e.g. module 1.4.0 ↔ Trident 1.4.0).
[1.5.2] - 2026-07-23
Versioning: re-syncs the module to the current engine — it pairs with
Trident 1.5.2. The jump from 1.4.0 to 1.5.2 folds in the 1.5.0
observability admin-API surface (built earlier but never released) plus the
client-reliability fixes below.
Added — Trident 1.5.0 observability admin surface
- Admin screens +
TridentClientmethods for the 1.5.x admin API: status
(/admin/status), explain (/admin/explain), Reflect (status/queue/
enable/disable), Launch, Cache Warmer, Backends (drain/restore),
Bans, DNS discovery, and Denoisers — matching Trident's OpenAPI
spec. Integration test coverage for the client, config, observers, and plugins.
Fixed — admin-API client reliability (Model/TridentClient.php)
- Every request now applies connect + read timeouts (5s/10s). Previously
most methods (including the observer-triggeredpurgeTags/purgeAllthat run
synchronously on the storefront) issued curl calls with no timeout, so an
unreachable or wedged Trident admin port could hang a Magento admin save or a
storefrontType::clean. - The shared-Curl DELETE verb can no longer leak. Every request re-pins
CURLOPT_CUSTOMREQUESTviaprepareRequest(), so a prior DELETE cannot cause
a following GET/POST on the injected singleton Curl to be issued as a DELETE. - The admin API token is now required to enable purges. With FPC on engine 3
but noapi_tokenset, the client no longer fires empty-Bearer401s that
were swallowed into permanent stale content — it disables cleanly and logs one
distinct, debug-independent warning so the misconfiguration is visible. - Non-2xx admin responses are logged (401/5xx) instead of being silently
discarded, on every request path.
Known follow-ups (not in this release)
- POST-gate the mutating admin controllers (
HttpPostActionInterface) and add a
form_keyto each admin POST form — requires validation in a Magento
environment; adminhtml URL secret-keys already provide CSRF protection. - Align tag casing between the two purge trigger paths.
- Remove dead surfaces (
PurgeStrategyisENABLED=false;ttl_staticis read
but never applied).
[1.4.0] - 2026-06-16
Versioning: this release realigns the module version with the Trident
engine — it pairs with Trident 1.4.0. The jump from 1.2.x to 1.4.0 syncs
the two; future releases will continue to match the engine version.
Fixed — admin API parity with Trident's OpenAPI spec
The admin parity screens added in 1.2.0 were corrected to read Trident's actual
admin-API response fields. Several referenced names that do not exist (so
columns rendered blank or wrong), and two write calls used the wrong shape:
- DNS Discovery — read
backend_name/hostname/addresses/
stats.last_success(werename/dns_name/resolved_addresses/
last_refresh); "resolving" status is derived from resolved addresses.
TridentClient::refreshDiscovery()now sends the requirednamequery param,
and the Refresh action re-resolves every discovered target. - Bans — read
ban_type/active/affected(weretype/
expires_at);TridentClient::createBan()sendstype(wasban_type);
ban types areurl/tag/pattern— the invalidhosttype was removed. - Backends — per-backend cards use
host:port/status/
total_requests/total_errors/avg_response_ms/active_connections
(wereurl/drained/weight/avg_latency_ms); connection pools read
name/max/queued(werebackend/max_connections/
waiting_requests). - Cache Warmer — last-run "Finished At" reads
completed_at(wasfinished_at). - Statistics — latency request count reads
count(wasrequest_count).
This brings the 1.2.0 admin feature parity and the 1.2.1 Cache Coverage screen
(both below) to their first correctly-rendering release.
[1.2.1] - 2026-06-07
Added
- Cache Coverage (
trident/cache/coverage) — paste a list of URLs and see which
are currently cached (freshness/age/TTL/size) plus the overall cached percentage,
via the newPOST /admin/cache/coverageendpoint (TridentClient::cacheCoverage()).
Useful for verifying a warm run landed. Accessible via System > Trident Cache >
Cache Coverage.
[1.2.0] - 2026-06-04
Added — admin feature parity with the Trident admin panel
Brings the full Trident operator surface into the Magento backend (System > Trident Cache).
Each screen follows the existing controller/ViewModel/template/ACL pattern and talks to the
admin API through Model\TridentClient (extended with ~30 new methods + shared GET/POST/DELETE helpers).
- Cache Warmer (
trident/warmer) — status (state, current-run progress, last-run summary),
Run-now (optional URL list), Cancel. - Launch Mode (
trident/launch) — start (URL list, auto-complete, bypass IPs), live state +
progress, complete (go-live), abort. - Reflect Mode (
trident/reflect) — emergency origin shield; enable (full/selective/ttl_extension- duration/reason), disable (replay = hard-purge, or soft-purge = mark stale for lazy
revalidation), queued-purge view, active warning banner.
- duration/reason), disable (replay = hard-purge, or soft-purge = mark stale for lazy
- Denoisers (
trident/denoisers) — query-scope + path-zone report, per-row pin/unpin/reset, WAF export. - Bans (
trident/bans) — list active/expired soft-purge bans, create (url/tag/host), delete. - Backends (
trident/backends) — per-backend health cards (drain/restore) + connection-pool table. - DNS Discovery (
trident/dns) — discovered targets table + refresh. - Live Events (
trident/events) — poll-based console over the SSE streams (requests/cache/backends/errors). - Richer Statistics — latency percentiles, recent errors, protection summary, BP-59 memory layout.
- Expanded Purge — purge by host and by Vary (in addition to all / tags / url / pattern).
[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-Controlheader 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-maxageand grace period forstale-while-revalidateinstead of copyingmax-age. - Config.php — Removed
PageCacheConfigdependency, reads caching application type directly fromScopeConfig.
[1.0.1] - 2026-02-15
Fixed
purgePattern()wrong API endpoint —TridentClient::purgePattern()was calling/admin/purge/patternwhich 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
- Cache status bar on Cache Management page — Displays Trident cache statistics (entries, memory, hit ratio, hits, misses, purge mode) directly on Magento's System > Cache Management page.
- "Purge Trident Cache" button on Cache Management page — Adds a purge button to Magento's native cache management page with ACL permission check and confirmation dialog.
CacheTypePlugintag-based purge — Intercepts programmaticPageCache\Type::clean(tags)calls that bypass theclean_cache_by_tagsevent (e.g. from third-party extensions). Filters out Magento-internalFPCtag. This covers an invalidation path that even Magento's own Varnish module does not handle.PurgeStrategyfor smart tag filtering — Optional optimization to filter out category listing tags (cat_c_p_{id}) for product saves where only detail-level attributes changed. Currently disabled, to be enabled via admin config after testing.
Changed
CacheTypePlugincleaned up — Removed logger dependency, added proper PHPDoc with FQDN types, addedFPCtag filtering to prevent sending Magento-internal tags to Trident.FlushCacheByTagsObserverusesPurgeStrategy— Tag filtering is now applied before sending purge requests to Trident.
[1.0.0] - 2026-02-10
Added
- Initial release of Qoliber_TridentCache Magento 2 module.
- Full Page Cache integration with Trident cache server.
- Tag-based cache invalidation via
FlushCacheByTagsObserverusing Magento's nativeTag\Resolver. - Full cache flush via
CacheFlushObserveron admin cache flush events. CacheTypePlugininterceptingPageCache\Type::clean()for full flush.ResponsePluginensurings-maxageheader on cacheable responses.ApplicationPluginadding Trident option to cache application dropdown.- Admin panel with cache statistics dashboard and manual purge controls.
- ACL permissions for cache purge and statistics access.
- Configurable API URL and token via Magento admin (Stores > Configuration > System > FPC).
- Sensitive config handling (API token marked as sensitive/environment).
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 1.5.2 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-07-23 11:06:24 |
| 1.1.0 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-03-06 12:10:01 |
| 1.0.1 | stable | Not tested | Not yet tested Details | 2026-02-15 16:50:17 |
| 1.0.0 | stable | Not tested | Not yet tested Details | 2026-02-13 16:43:22 |
Requires 7
| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-catalog | * |
| magento/module-cms | * |
| magento/module-customer | * |
| magento/module-page-cache | * |
| magento/module-store | * |
| php | >=8.1 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. 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 | Fail | 318 | 3 errors, 315 warnings (ruleset: Magento2), 5 auto-fixable with phpcbf |
| PHPMD | Warning | 37 | 37 rule violations (UnusedPrivateField:37) |
| Cpd | Warning | 2 | 2 duplicated chunks spanning 46 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 7 | valid; 7 advisory notes (composer validate --strict) |
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from qoliber
View vendorNebula admin theme and modules for Magento 2 / Mage-OS. Targets Magento 2.4.7+ (or Mage-OS 2.0+) on PHP 8.1+.
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.