guzzlehttp/cache-subscriber
A Guzzle subscriber that adds caching to HTTP requests, letting you store and reuse responses to reduce redundant network calls. Now deprecated in favor of Guzzle's built-in cache middleware, it remains useful for older projects needing simple response caching.
Http facade / Guzzle across many integrations, this package is evidence for building a thin, first-party caching wrapper you control — because the ecosystem's canonical options here are abandoned or unmaintained.Use cases it legitimately illustrates: idempotent GETs against read-mostly vendor endpoints, per-user vs. shared cache keying, honoring Cache-Control/ETag/Vary from upstream, and storing responses in PSR-6-compatible backends (Redis, filesystem) so cache state survives deploys.
Criteria for adoption — essentially none for new work. Only consider it if all of the following are true:
When to look elsewhere — the default path:
Http client with a first-party cache decorator, or kevinrob/guzzle-cache-middleware (actively maintained, Guzzle 6/7, PSR-16 storage) if you want an off-the-shelf middleware.Cache::remember() around a small repository/service class is easier to test, easier to invalidate, and does not couple your cache keys to HTTP semantics.Vary mishandling here become data-leak or stale-entitlement bugs that are expensive to find.Practical trigger: if a spike shows a metered third-party API is a top-5 cost line or a top-3 p95 latency contributor, act on it — but with a maintained library, not this one. If neither is true, deprioritize the whole caching conversation.
To executives (30 seconds): We evaluated a library for caching responses from external APIs — the kind of thing that lowers vendor bills and makes our pages faster when a partner is slow. This specific package is archived, unmaintained since 2019, and has no adopters in the ecosystem, so we are not putting it in production. Its value to us is as a blueprint: it tells us exactly which levers exist and what governance we need. Recommendation: do not adopt; fund a small, owned caching layer in our HTTP client instead. Cost is measured in days, not a dependency risk.
To engineering: The package is a Guzzle 5 middleware implementing a private transparent proxy cache — it stores GET responses keyed by URL plus Vary, honors upstream Cache-Control/ETag, and persists to a PSR-6 pool. The pattern is sound; the artifact is not. Concretely: it is [DEPRECATED], the repo is archived, the last release was 2019-09-16, and it has zero dependents — which means no one is exercising it against current Guzzle, PHP 8, or current cache backends. If we want this behavior, implement it as a thin middleware or decorator over Illuminate\Support\Facades\Http using the framework's cache repository, with an explicit per-integration policy: key composition (including tenant/user when responses are personalized), TTL, whether to serve stale on upstream failure, and whether to bypass entirely for mutating or auth-sensitive calls. Ship it with hit-rate, latency-delta, and vendor-spend metrics from day one so we can prove the win and catch stale-data incidents early. Reserve one review per quarter so the layer does not silently rot the way this package did.
Risk summary to keep on the record: deprecated and archived; no security patching; Guzzle 5-only and therefore a PHP-version and dependency-resolution liability; zero dependents means zero ecosystem validation; transparent HTTP caching is a poor fit for authenticated or personalized responses and a common source of stale-data and cache-key bugs.
How can I help you explore Laravel packages today?