Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cached Http Client Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Pre-1.0 churn. Two releases, one of which removes a public function. No stability contract; expect further breaks before 1.0.
  • Single-maintainer / bus factor. All commits in this release are by one author. No evidence of a maintainer group, security policy, or release cadence.
  • Cache-correctness risk. "Create a cacheable response" is a behavioural change in the core value proposition. If the layer does not correctly honour 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.
  • Silent dependency risk. Cache backend, TTL policy, and HTTP client version are all configuration the package does not own.

Key questions.

  1. Is the cacheable-response change backward compatible for consumers who only read status/body/headers, and what breaks for those who type-hinted the old response?
  2. Does the cache key include method, full URL, query string, Vary dimensions, and auth identity — and is no-store/Set-Cookie/Authorization respected?
  3. Is there a Laravel service provider, or is this Symfony-only? If the latter, what is the binding effort?
  4. What is the supported PHP/Laravel/Symfony version matrix, and is it tested in CI?
  5. Is there a documented cache invalidation/TTL strategy, or is that entirely the integrator's responsibility?

Integration Approach

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:

  1. Pin 0.2.0 exactly (not ^0.2) — 0.x ranges permit breaking minors.
  2. Land an adapter with contract tests covering: cache miss → hit, Vary-differing requests, authenticated vs anonymous, no-store, and error responses.
  3. Compare v0.1.1 vs v0.2.0 behaviour in staging on a non-critical endpoint before wider adoption.

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.

  1. Spike: install in a scratch Laravel app, bind the client, prove caching works and is correctly partitioned.
  2. Define the internal gateway interface and write the contract tests.
  3. Adopt for one low-risk outbound integration (e.g. a read-only reference-data API), measure hit rate and latency.
  4. Only then extend to authenticated or higher-volume calls, after cache-key and Vary behaviour is signed off.

Operational Impact

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.

  • Stale or cross-tenant data if keys omit auth identity or Vary dimensions — highest severity, data-exposure class.
  • Cache poisoning / negative caching if error responses or 4xx/5xx are cached with a long TTL.
  • Hard failure on upgrade when request() disappears in a future minor.
  • Cache stampede on synchronised TTL expiry.
  • Silent bypass if the cache store is unreachable and the client either fails closed (outage) or fails open (unexpected load on the upstream API) — the behaviour must be chosen deliberately, not inherited by accident.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle