spatie/laravel-responsecache
Cache full Laravel responses to speed up your app. Automatically caches successful text-based GET requests (HTML/JSON), with easy middleware per route, configurable lifetimes, and optional stale-while-revalidate “grace” caching to refresh in the background.
Adopt when:
Look elsewhere if:
spatie/laravel-cache.spatie/laravel-cache.For Executives:
"This package lets us instantly speed up our slowest endpoints by caching full HTTP responses—like hitting ‘save’ on a webpage’s performance. For example, our /products page could load 10x faster with minimal code changes. It’s a zero-cost optimization that reduces server costs and improves user experience, especially for high-traffic routes. We’ll start with non-critical pages (e.g., dashboards) and expand to public-facing content. The risk is low—we can toggle it off if needed."
For Engineering: "spatie/laravel-responsecache is a drop-in middleware that caches entire responses (HTML/JSON) at the HTTP layer, bypassing Laravel’s request pipeline for cached hits. Key benefits:
CacheResponse::for(minutes(10))) or flexible caching (serve stale responses while refreshing in the background).#[Cache], #[NoCache]) or route middleware for per-endpoint config.Proposal: Pilot on our /analytics and /docs routes (low-risk, stale data acceptable). Expect ~50–90% reduction in backend load for cached routes. Tradeoff: Slight complexity in cache invalidation (but we’ll use tags for critical updates)."*
How can I help you explore Laravel packages today?