mrgoodbytes8667/cached-http-client-bundle
A cached HTTP client wrapper that stores outbound responses so repeated API calls skip the network, cutting latency and rate-limit pressure. Configure cache TTLs and stores, then reuse responses across requests in Laravel and PHP apps.
Architecture fit. This package is a thin caching layer over a PSR-18/Symfony HTTP client, released as a "bundle" — which suggests Symfony Kernel integration rather than native Laravel service-provider wiring. For a Laravel/PHP stack it can still be used as a standalone composer dependency if the caching decorator is framework-agnostic, but TPM should treat the framework fit as unproven until a Laravel adapter or manual container binding is validated. Architecturally it is a cross-cutting concern (outbound HTTP + response caching), so it belongs behind an internal client interface rather than being referenced directly in domain code.
Integration feasibility. Low-to-moderate effort: composer install, client configuration, cache backend selection (PSR-6/PSR-16 or Symfony cache pool), and a test harness that asserts cache hits/misses. v0.2.0 changes two things that matter: it removes the deprecated request() function (a breaking API removal, permitted under 0.x semantics but still a consumer-facing break), and it changes the client to create a cacheable response, which alters the object produced on a miss and therefore how responses are stored, replayed, and typed against. Any code calling request() or relying on the previous response type must be updated and re-tested.
Technical risk.
Vary, Cache-Control/no-store, Authorization headers, and per-user partitioning, it can serve one user's authenticated response to another. This is the highest-severity risk in the package and is not addressed in the notes.Key questions.
Vary dimensions, and auth identity — and is no-store/Set-Cookie/Authorization respected?Stack fit. PHP 8.x with Composer; PSR-18/Symfony HttpClient as the transport. In Laravel, expect to register the client and cache pool manually in a service provider and bind an interface; in Symfony, native bundle registration. The package should sit in the infrastructure layer, wrapped by an internal HttpGateway interface, so a future swap (Guzzle + custom middleware, Laravel's Http::cache(), or a fork) costs one adapter rather than a refactor.
Migration path. There is nothing to migrate from at the platform level, but consumers already on v0.1.x who use request() must migrate within the package: replace request() calls with the new entry point and re-verify the returned response type. Recommended path:
0.2.0 exactly (not ^0.2) — 0.x ranges permit breaking minors.Vary-differing requests, authenticated vs anonymous, no-store, and error responses.Compatibility. Breaking change confined to request() removal and the response type. Anything that only consumes status/body/headers is likely unaffected but should be proven, not assumed. Verify PHP version constraints and that the transitive HTTP client and cache libraries resolve against the versions already in the lockfile; a second PSR-18 implementation in the tree is a common source of confusion.
Sequencing.
Vary behaviour is signed off.Maintenance. Expect to track releases closely: pre-1.0 with a demonstrated willingness to delete public API means upgrades are not drop-in. Budget a small recurring cost per release (read changelog, run contract tests, re-pin). The wrapper interface is the main mitigation — it localises upgrade work.
Support. Community-only, effectively single-maintainer. No vendor to escalate to; no LTS. If this becomes load-bearing for outbound traffic, the team owns the fork-or-replace contingency. That is acceptable for an internal convenience layer and not acceptable for a business-critical dependency without a documented exit plan.
Scaling. The cache layer is a genuine lever on latency, third-party rate limits, and cost-per-call — this is the reason to adopt it. Scaling concerns move to the cache store: size, eviction policy, and hot-key behaviour. Watch for cache stampede on expiry for high-traffic endpoints (many simultaneous misses on the same key), and for unbounded growth if keys are not normalised.
Failure modes.
Vary dimensions — highest severity, data-exposure class.4xx/5xx are cached with a long TTL.request() disappears in a future minor.Ramp-up. Low for a mid-level PHP engineer: the API surface is small and the concept (cache the HTTP response) is familiar. The real learning curve is HTTP caching semantics — Vary, Cache-Control, conditional requests, and key design — which is a TPM-level review concern rather than an implementation detail. Allocate a short design review with whoever owns the cache backend before the first production endpoint, and require the contract tests above as the entry gate.
How can I help you explore Laravel packages today?