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
Caching Guzzle

Caching Guzzle Laravel Package

brightfish/caching-guzzle

Caches Guzzle HTTP responses so repeated API calls can be served from your Laravel cache instead of hitting the network again, with configurable TTLs and cache keys for controlling what gets stored and for how long.

View on GitHub
Deep Wiki
Context7

brightfish/caching-guzzle adds transparent response caching to any Guzzle HTTP client, so repeated requests are served from cache instead of hitting the network. Drop it into an existing client stack and responses are stored and replayed automatically—no changes to your calling code.

  • Pluggable PSR-16 cache backend
  • Configurable TTL for cached responses
  • Automatic cache-key generation from request data
  • Installs as standard Guzzle middleware
  • Framework-agnostic and Laravel-friendly
Frequently asked questions about Caching Guzzle
What is brightfish/caching-guzzle and how does it fit into a Laravel app?
It is a Guzzle middleware that caches outbound HTTP responses in a cache store, reducing repeated calls to slow or rate-limited third-party APIs. Laravel's HTTP client is built on Guzzle, so the package can be relevant for service-layer clients that perform read-only API calls. It is not Laravel-first, so expect to add custom glue rather than relying on framework-level configuration. Avoid applying it globally to all Laravel HTTP traffic.
How do I install and register brightfish/caching-guzzle?
Install it with Composer using the package name brightfish/caching-guzzle. You then attach the middleware to a Guzzle handler stack for the specific client or request path you want to cache. Laravel's HTTP client does not expose a simple first-class middleware registration API, so you will usually need a custom client factory or service wrapper. Validate middleware ordering against auth, retries, logging, and tracing before production use.
Which PHP, Guzzle, and Laravel versions does it support?
The supplied context does not include a clear, current compatibility matrix, and the package has no recent release since April 2023. Treat PHP, Guzzle, and Laravel support as something to verify with a short non-production spike. Inspect composer.json constraints and test against your exact versions, especially if you use Laravel's HTTP client features such as retries and middleware pipelines. Lock the tested matrix in your own project documentation.
How are cache keys composed, and can I customize them?
The overview mentions configurable cache keys, but the exact default composition is not documented in the supplied context. Review the source and explicitly include method, normalized URI, query string, relevant headers, auth scope, tenant or user identifier, and a key version namespace where needed. Do not rely on defaults for authenticated, personalized, or multi-tenant endpoints. Weak key design can silently return stale or cross-tenant data.
Does it use Laravel's cache store or PSR-6/PSR-16?
The package description says responses are cached in your chosen cache store, but it does not clearly state whether that means Laravel's Cache facade, a PSR-6 or PSR-16 implementation, or its own storage abstraction. Confirm this before adoption because it affects configuration, clearing, and multi-node behavior. In production, use a shared Redis or Memcached backend rather than file or in-process caching. Local caches can make responses inconsistent across application nodes.
Can I cache only specific requests or HTTP methods?
The package blurb says you can configure which requests are cached, which is important because caching should be selective. Restrict it to idempotent GET reads where stale data is acceptable, and avoid caching POST, PUT, PATCH, DELETE, streaming, or file-download responses. Prefer wrapping it behind an internal cached client or service interface so call sites can opt in explicitly. Do not attach it as global middleware for all outbound HTTP traffic.
Does it cache error responses or non-idempotent requests?
The supplied context does not document how errors and non-idempotent requests are handled. Guzzle middleware can cache whatever response passes through unless your configuration filters it, so add explicit bypass rules for non-2xx responses, mutation methods, streaming responses, and user-specific data. Test timeout, retry, and exception behavior carefully. Caching an error or a failed auth response can create confusing production incidents.
How do I handle cache invalidation and stale data?
TTL-based expiry is the minimum control, but you should also define manual purge procedures by key namespace, bypass rules for forced refreshes, and fail-open or fail-closed behavior. The context does not document concurrency or cache-stampede handling, so consider application-level locking or stale-while-revalidate if many requests can miss at once. Add dashboards for hit rate, latency, eviction, and stale-response indicators. Require an internal runbook for TTL tuning and key-schema changes.
Is brightfish/caching-guzzle safe for authenticated or multi-tenant APIs?
It is high risk unless you control cache key composition very carefully. Keys must include tenant, user, or auth scope so one customer cannot receive another customer's cached response. The safer pattern is to use the package only for bounded, public, idempotent GET requests and wrap it behind an internal interface. Avoid default or global caching for authenticated traffic without explicit review and tests.
Is the package maintained, and what about GPL-3.0 licensing?
Adoption signals are low, with about 10 stars and zero dependents in the supplied assessment, and no release since April 2023, so treat it as effectively unmaintained unless you are prepared to fork or own it internally. GPL-3.0 requires legal review before use in proprietary Laravel applications. If maintenance or licensing blocks adoption, implement an in-house Guzzle middleware backed by Laravel Cache or use it only as a behavioral reference. Budget for dependency upgrades, security patches, and license tracking.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager