saloonphp/cache-plugin
Cache plugin for Saloon adds response caching to your API integrations, storing HTTP responses so repeated requests are served from cache instead of hitting the network. Configure cache drivers, TTLs, and per-request rules to speed up your app.
clearCache() method purges a cached response without sending an outbound request. That single capability unlocks product features we would otherwise defer: an admin "refresh data" action, webhook- or event-driven invalidation after an upstream change (price update, catalog sync, profile edit), and post-deploy cache warming. Without it, invalidation required either a throwaway request or manual cache-backend surgery — a cost that quietly kills otherwise-viable caching features.Representative use cases: e-commerce product/pricing snapshots purged on catalog sync; SaaS profile/config reads purged on profile update; internal dashboards fronting CRM/ERP APIs with an operator-triggered refresh; any Saloon v4 client hitting a rate-limited third party.
Adopt when most of these hold:
clearCache() covers the "purge this one thing now" case well.withCache() on a request or connector, no refactor, no new service.Look elsewhere — or build — when:
clearCache() is single-entry; it is not a cache management layer.For executives — the decision in one paragraph: "We are already paying for every outbound API call, in money and in latency. This is the official, MIT-licensed caching plugin for Saloon, the HTTP layer we already use, and it now supports Saloon v4 plus on-demand cache purging. That combination matters: it means we can cache read-heavy third-party data aggressively without accepting stale data as the price of admission — a webhook or an admin action clears the entry immediately. It is a small dependency over cache infrastructure we already run, requires no architectural change, and can be piloted inside one module. The honest caveat is that the project is small and effectively single-maintainer; the mitigation is that it is a thin adapter we could replace in days, not a platform we would be trapped in. Recommendation: approve a scoped pilot, not a company-wide mandate."
For engineering — what it is and what we'd own:
withCache()), with clearCache() for explicit purge. No middleware plumbing to write, no changes to how requests are defined.clearCache() wired to a real invalidation event. Success criteria: measured reduction in outbound calls, p95 latency improvement, and zero stale-data incidents across the pilot window. Exit criteria defined up front, and a fallback that is a same-sprint swap back to uncached calls.How can I help you explore Laravel packages today?