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.
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.4.0...8.4.1
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.3.1...8.4.0
CacheResponse middleware between handle() and terminate() when the middleware is not resolved as the same instance. State now travels on the request attributes. (#518)Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.2.0...8.3.0
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/8.1.0...8.2.0
For pages where brief staleness is acceptable, you can now use flexible caching. After the lifetime expires, the stale response is still served instantly while the cache refreshes in the background. Once the grace period is over, the cache is considered expired and the next request will be fully recalculated:
use Spatie\ResponseCache\Middlewares\FlexibleCacheResponse;
Route::get('/dashboard', [DashboardController::class, 'index'])
->middleware(FlexibleCacheResponse::for(lifetime: hours(1), grace: minutes(5)));
You can now use attributes on controllers instead of middleware parameters:
use Spatie\ResponseCache\Attributes\Cache;
use Spatie\ResponseCache\Attributes\FlexibleCache;
use Spatie\ResponseCache\Attributes\NoCache;
#[Cache(lifetime: 3600, tags: ['dashboard'])]
public function index() { ... }
#[FlexibleCache(lifetime: 3600, grace: 300)]
public function show() { ... }
#[NoCache]
public function admin() { ... }
Event suffix (e.g. CacheMissed → CacheMissedEvent)cacheRequestUntil() with cacheLifetimeInSeconds() in CacheProfile interfaceCacheResponse::using() with CacheResponse::for() and FlexibleCacheResponse::for()clear() and forget()Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.2...8.0.0
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.1...7.7.2
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.7.0...7.7.1
ClearingResponseCacheFailed and return boolean by clear() by @alies-dev in https://github.com/spatie/laravel-responsecache/pull/495Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.5...7.7.0
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.4...7.6.5
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.3...7.6.4
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.2...7.6.3
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.1...7.6.2
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.6.0...7.6.1
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.2...7.6.0
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.1...7.5.2
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.5.0...7.5.1
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.10...7.5.0
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.9...7.4.10
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.7...7.4.8
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.6...7.4.7
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.4...7.4.5
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.3...7.4.4
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.2...7.4.3
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.1...7.4.2
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.4.0...7.4.1
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.3.1...7.4.0
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.3.0...7.3.1
Full Changelog: https://github.com/spatie/laravel-responsecache/compare/7.2.0...7.3.0
How can I help you explore Laravel packages today?